Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit02b88e1

Browse files
committed
Preparing for CRAN submission
1 parentcf16688 commit02b88e1

21 files changed

+179
-138
lines changed

‎.Rbuildignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ extra/*
99
^_pkgdown\.yml$
1010
^docs$
1111
^pkgdown$
12+
^CRAN-SUBMISSION$

‎CRAN-SUBMISSION‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Version: 1.0.0
2+
Date: 2024-07-14 16:18:21 UTC
3+
SHA: cf16688021606b21a9f4ec274e2dd4ebd51210dc

‎LICENSE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
YEAR:2020
1+
YEAR:2024
22
COPYRIGHT HOLDER: Pablo Paccioretti

‎LICENSE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#MIT License
22

3-
Copyright (c)2020 Pablo Paccioretti
3+
Copyright (c)2024 Pablo Paccioretti
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

R/compare_zones.R renamed to R/compare_zone.R

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,15 @@
1010
#' @param grid_dim \code{numeric} grid dimentins to estimate spatial variance
1111
#'
1212
#' @return \code{list} with differences and descriptive_stat
13+
#' @references
14+
#' Paccioretti, P., Córdoba, M., & Balzarini, M. (2020).
15+
#' FastMapping: Software to create field maps and identify management zones
16+
#' in precision agriculture. Computers and Electronics in Agriculture, 175,
17+
#' 105556 https://doi.org/10.1016/j.compag.2020.105556.
1318
#' @export
1419
#'
15-
#' @examples
20+
#' @example inst/examples/compare_zone.R
1621
#'
17-
#' library(sf)
18-
#' data(wheat, package = "paar")
19-
#'
20-
#' ##Convert to an sf object
21-
#' wheat <- sf::st_as_sf(wheat,
22-
#' coords = c("x", "y"),
23-
#' crs = 32720)
24-
#' clusters <- paar::kmspc(
25-
#' wheat,
26-
#' variables = c('CE30', 'CE90', 'Elev', 'Pe', 'Tg'),
27-
#' number_cluster = 3:4
28-
#' )
29-
#' data_clusters <- cbind(wheat, clusters$cluster)
30-
#' compare_zone(data_clusters,
31-
#' "Elev",
32-
#' "Cluster_3")
3322

3423
compare_zone<-function(data,
3524
variable,
@@ -317,7 +306,6 @@ CalcLetras <- function(myMeans, pvalue, alpha = 0.05) {
317306
if (chequeo>n)
318307
break
319308
for (iinj:n) {
320-
# browser()
321309
stest<-Qm[q[i],q[j]]>alpha
322310
if (stest) {
323311
if (lastC(M[i])!=letras[k]) {
@@ -330,7 +318,7 @@ CalcLetras <- function(myMeans, pvalue, alpha = 0.05) {
330318
cambio1<-0
331319
ja<-j
332320
for (jjincambio:n)
333-
M[jj]<- paste(M[jj],"",sep="")# El espacio
321+
M[jj]<- paste(M[jj],"",sep="")
334322
M[cambio]<- paste(M[cambio],letras[k],sep="")
335323
for (vinja:cambio) {
336324
if (Qm[q[v],q[cambio]]<=alpha) {
@@ -346,15 +334,14 @@ CalcLetras <- function(myMeans, pvalue, alpha = 0.05) {
346334
if (cambio1==0)
347335
j<-j+1
348336
}
349-
#-----------
350-
# browser()
337+
351338
w<-data.frame(w,stat=M)
352339
if (k>81
353340
)
354341
cat(
355342
"\n",
356343
k,
357-
"groups are estimated.The number of groups exceeded the maximum of 81 labels.change to group=FALSE.\n"
344+
"groups are estimated.The number of groups exceeded the maximum of 81 labels.Change to group=FALSE.\n"
358345
)
359346
invisible(w)
360347
}

‎R/depurate.R‎

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,33 @@
44
#' outliers and spatial outliers or local defective observations. Default
55
#' values are optimized for precision agricultural data.
66
#'
7-
#' @inheritParams remove_border
8-
#' @inheritParams remove_outlier
9-
#'@inheritParams remove_inlier
7+
#' @param x an \code{sf} points object
8+
#' @param y \code{character} with the name of the variable to use for
9+
#' depuration/filtering process
1010
#' @param toremove \code{character} vector specifying the procedure to
1111
#' implement for errors removal. Default 'edges', 'outlier', 'inlier'.
1212
#' See Details.
13+
#' @param crs coordinate reference system: integer with the EPSG code,
14+
#' or character with proj4string to convert coordinates if \code{x} has
15+
#' longitude/latitude data
16+
#' @param buffer \code{numeric} distance in meters to be removed. Negative
17+
#' values are recommended
18+
#' @param ylimitmax \code{numeric} of length 1 indicating the maximum limit
19+
#' for the \code{y} variable. If \code{NA} \code{Inf} is assumed
20+
#' @param ylimitmin \code{numeric} of length 1 indicating the minimum limit
21+
#' for the \code{y} variable. If \code{NA} \code{-Inf} is assumed
22+
#' @param sdout \code{numeric} values outside the interval
23+
#' \eqn{mean ± sdout × sdout} values will be removed
24+
#' @param ldist \code{numeric} lower distance bound to identify neighbors
25+
#' @param udist \code{numeric} upper distance bound to identify neighbors
26+
#' @param criteria \code{character} with "LM" and/or "MP" for methods to
27+
#' identify spatial outliers
28+
#' @param zero.policy default NULL, use global option value;
29+
#' if FALSE stop with error for any empty neighbors sets,
30+
#' if TRUE permit the weights list to be formed with zero-length
31+
#' weights vectors
32+
#' @param poly_border \code{sf} object with one polygon or NULL. Can be
33+
#' the result of \code{concaveman::concaveman}
1334
#'
1435
#' @details
1536
#' Possible values for \code{toremove} are one or more elements of:
@@ -26,7 +47,13 @@
2647
#' automating error removal from yield maps. Precision Agric 20, 1030–1044
2748
#' (2019). https://doi.org/10.1007/s11119-018-09632-8
2849
#'
29-
#' @return an object of class \code{paar}
50+
#' @return an object of class \code{paar} with two elements:
51+
#' \describe{
52+
#' \item{depurated_data}{\code{sf} object with the data after the removal
53+
#' process}
54+
#' \item{condition}{\code{character} vector with the condition of each
55+
#' observation}
56+
#' }
3057
#' @export
3158
#' @example inst/examples/depurate.R
3259

@@ -141,7 +168,8 @@ depurate <- function(x,
141168
#' values are recommended
142169
#' @param poly_border \code{sf} object with one polygon or NULL. Can be
143170
#' the result of \code{concaveman::concaveman}
144-
#'
171+
#' @noRd
172+
#' @keywords internal
145173
remove_border<-function(x,
146174
crs=NULL,
147175
buffer,
@@ -282,8 +310,8 @@ remove_border <- function(x,
282310
#' for the \code{y} variable. If \code{NA} \code{-Inf} is assumed
283311
#' @param sdout \code{numeric} values outside the interval
284312
#' \eqn{mean ± sdout × sdout} values will be removed
285-
#'
286-
#'
313+
#' @noRd
314+
#' @keywords internal
287315
remove_outlier<-function(x,
288316
y,
289317
ylimitmax=NA,
@@ -351,7 +379,8 @@ remove_outlier <- function(x,
351379
#' if FALSE stop with error for any empty neighbors sets,
352380
#' if TRUE permit the weights list to be formed with zero-length
353381
#' weights vectors
354-
#'
382+
#' @noRd
383+
#' @keywords internal
355384
remove_inlier<-function(x,
356385
y,
357386
ldist=0,
@@ -442,6 +471,7 @@ remove_inlier <- function(x,
442471
#' @param is_error internal object
443472
#' @param remove_result internal results from remove_* functions
444473
#' @noRd
474+
#' @keywords internal
445475
is_error_update<-function(is_error,remove_result) {
446476
# Keeps NA, others are conditions
447477
is_error_no_na<-is_error[is.na(is_error$because),]

‎R/fuzzy_k_means.R‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#' @return a list with classification results and indices to select best number of
1010
#' clusters.
1111
#' @export
12+
#' @example inst/examples/fuzzy_k_means.R
1213
#'
1314
fuzzy_k_means<-function(data,
1415
variables,

‎R/kmspc.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' MULTISPATI-PCA clustering
22
#'
33
#'
4-
#' @inheritParamsremove_inlier
4+
#' @inheritParamsdepurate
55
#' @param data sf object
66
#' @param variables variables to use for clustering, if missing, all numeric
77
#' variables will be used

‎R/spatial_t_test.R‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
#' columns \code{matrix} or \code{data.frame} specifying coordinates.
99
#'
1010
#' @param variables \code{character} vector with column names to perform ttest
11-
#'
11+
#' @return a data.frame with the correlation and p-value for each pair
12+
#' of variables
1213
#' @export
1314

1415

1516
spatial_t_test<-function(data,variables) {
1617

1718
if (!requireNamespace("SpatialPack",quietly=TRUE)) {
1819
stop(paste0("SpatialPack package is needed to perform spatial_t_test","\n",
19-
"Install it with 'install.packages(SpatialPack)'"),
20+
"Install it with 'install.packages(\'SpatialPack\')'"),
2021
.call=FALSE)
2122
}
2223

‎README.Rmd‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ precision agriculture spatial data depuration.
2727

2828
##Installation
2929

30-
<!--You can install the released version of paar from [CRAN](https://CRAN.R-project.org) with:-->
30+
You can install the released version of paar from[CRAN](https://CRAN.R-project.org) with (not-yet):
3131

32-
<!--``` r-->
33-
<!-- install.packages("paar")-->
34-
<!--```-->
32+
```r
33+
# install.packages("paar")
34+
```
3535
You can install the development version from[GitHub](https://github.com/PPaccioretti/paar) with:
3636

3737
```r

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp