From 7a2895dd5bceac9af3371b37c2d67ccf985eb6de Mon Sep 17 00:00:00 2001 From: Andrea Manica Date: Fri, 3 Nov 2023 22:07:06 +0000 Subject: [PATCH] remove unicode --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/blockcv2rsample.R | 2 +- R/boyce_cont.R | 4 +-- R/kap_max.R | 4 +-- R/optim_thresh.R | 2 +- R/tss.R | 6 ++-- R/tss_max.R | 4 +-- cran_comments.md | 28 +++++++++++++++++++ .../helper_functions/submitting_to_cran.R | 3 ++ man/blockcv2rsample.Rd | 2 +- man/boyce_cont.Rd | 4 +-- man/kap_max.Rd | 4 +-- man/optim_thresh.Rd | 2 +- man/tss.Rd | 6 ++-- man/tss_max.Rd | 4 +-- 16 files changed, 55 insertions(+), 24 deletions(-) create mode 100644 cran_comments.md diff --git a/DESCRIPTION b/DESCRIPTION index bd405115..7754e20a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tidysdm Title: Species Distribution Models with Tidymodels -Version: 0.9.1.9001 +Version: 0.9.2 Authors@R: c( person("Michela", "Leonardi", role = "aut"), person("Margherita", "Colucci", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 6b59c348..39ae1273 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # `tidysdm` 0.9.2 -* Clean up for CRAN +* Release on CRAN # `tidysdm` 0.9.1 diff --git a/R/blockcv2rsample.R b/R/blockcv2rsample.R index 0715bf6e..629c91f6 100644 --- a/R/blockcv2rsample.R +++ b/R/blockcv2rsample.R @@ -16,7 +16,7 @@ #' k = 5, # number of folds #' size = 350000, # size of the blocks in metres #' selection = "random", # random blocks-to-fold -#' iteration = 50 +#' iteration = 10 #' ) # find evenly dispersed folds #' sb1_rsample <- blockcv2rsample(sb1, pa_data) #' class(sb1_rsample) diff --git a/R/boyce_cont.R b/R/boyce_cont.R index a42ae7b5..cffdbb1b 100644 --- a/R/boyce_cont.R +++ b/R/boyce_cont.R @@ -12,11 +12,11 @@ #' and estimate arguments, or a table/matrix where the true class #' results should be in the columns of the table. #' @param ... A set of unquoted column names or one or more dplyr selector functions to choose which variables contain the class probabilities. If truth is binary, only 1 column should be selected, and it should correspond to the value of event_level. Otherwise, there should be as many columns as factor levels of truth and the ordering of the columns should be the same as the factor levels of truth. -#' @param truth The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For ⁠_vec()⁠ functions, a factor vector. +#' @param truth The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a factor vector. #' @param estimator One of "binary", "hand_till", "macro", or "macro_weighted" to specify the type of averaging to be done. "binary" is only relevant for the two class case. The others are general methods for calculating multiclass metrics. The default will automatically choose "binary" if truth is binary, "hand_till" if truth has >2 levels and case_weights isn't specified, or "macro" if truth has >2 levels and case_weights is specified (in which case "hand_till" isn't well-defined). #' @param na_rm A logical value indicating whether NA values should be stripped before the computation proceeds. #' @param event_level A single string. Either "first" or "second" to specify which level of truth to consider as the "event". This argument is only applicable when estimator = "binary". The default uses an internal helper that generally defaults to "first" -#' @param case_weights The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For ⁠_vec()⁠ functions, a numeric vector. +#' @param case_weights The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For _vec() functions, a numeric vector. #' @param estimate If truth is binary, a numeric vector of class probabilities corresponding to the "relevant" class. Otherwise, a matrix with as many columns as factor levels of truth. It is assumed that these are in the same order as the levels of truth. #' @returns A tibble with columns .metric, .estimator, and .estimate and 1 row of values. #' For grouped data frames, the number of rows returned will be the same as the diff --git a/R/kap_max.R b/R/kap_max.R index 62adc2c9..a6963028 100644 --- a/R/kap_max.R +++ b/R/kap_max.R @@ -13,11 +13,11 @@ #' and estimate arguments, or a table/matrix where the true class #' results should be in the columns of the table. #' @param ... A set of unquoted column names or one or more dplyr selector functions to choose which variables contain the class probabilities. If truth is binary, only 1 column should be selected, and it should correspond to the value of event_level. Otherwise, there should be as many columns as factor levels of truth and the ordering of the columns should be the same as the factor levels of truth. -#' @param truth The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For ⁠_vec()⁠ functions, a factor vector. +#' @param truth The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a factor vector. #' @param estimator One of "binary", "hand_till", "macro", or "macro_weighted" to specify the type of averaging to be done. "binary" is only relevant for the two class case. The others are general methods for calculating multiclass metrics. The default will automatically choose "binary" if truth is binary, "hand_till" if truth has >2 levels and case_weights isn't specified, or "macro" if truth has >2 levels and case_weights is specified (in which case "hand_till" isn't well-defined). #' @param na_rm A logical value indicating whether NA values should be stripped before the computation proceeds. #' @param event_level A single string. Either "first" or "second" to specify which level of truth to consider as the "event". This argument is only applicable when estimator = "binary". The default uses an internal helper that generally defaults to "first" -#' @param case_weights The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For ⁠_vec()⁠ functions, a numeric vector. +#' @param case_weights The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For _vec() functions, a numeric vector. #' @param estimate If truth is binary, a numeric vector of class probabilities corresponding to the "relevant" class. Otherwise, a matrix with as many columns as factor levels of truth. It is assumed that these are in the same order as the levels of truth. #' @returns A tibble with columns .metric, .estimator, and .estimate and 1 row of values. #' For grouped data frames, the number of rows returned will be the same as the diff --git a/R/optim_thresh.R b/R/optim_thresh.R index e1779b81..e78e020a 100644 --- a/R/optim_thresh.R +++ b/R/optim_thresh.R @@ -6,7 +6,7 @@ #' @param truth The column identifier for the true class results (that is a #' factor). This should be an unquoted column name although this argument is #' passed by expression and supports quasiquotation (you can unquote column -#' names). For ⁠_vec()⁠ functions, a factor vector. +#' names). For _vec() functions, a factor vector. #' @param estimate the predicted probability for the event #' @param metric character of metric to be optimised. Currently only "tss_max", #' "kap_max", and "sensitivity" with a given target diff --git a/R/tss.R b/R/tss.R index af8f2155..3c671120 100644 --- a/R/tss.R +++ b/R/tss.R @@ -14,11 +14,11 @@ #' and estimate arguments, or a table/matrix where the true class #' results should be in the columns of the table. #' @param ... Not currently used. -#' @param truth The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For ⁠_vec()⁠ functions, a factor vector. -#' @param estimate The column identifier for the predicted class results (that is also factor). As with truth this can be specified different ways but the primary method is to use an unquoted variable name. For ⁠_vec()⁠ functions, a factor vector. +#' @param truth The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a factor vector. +#' @param estimate The column identifier for the predicted class results (that is also factor). As with truth this can be specified different ways but the primary method is to use an unquoted variable name. For _vec() functions, a factor vector. #' @param estimator One of: "binary", "macro", "macro_weighted", or "micro" to specify the type of averaging to be done. "binary" is only relevant for the two class case. The other three are general methods for calculating multiclass metrics. The default will automatically choose "binary" or "macro" based on estimate. #' @param na_rm A logical value indicating whether NA values should be stripped before the computation proceeds. -#' @param case_weights The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For ⁠_vec()⁠ functions, a numeric vector. +#' @param case_weights The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For _vec() functions, a numeric vector. #' @param event_level A single string. Either "first" or "second" to specify which level of truth to consider as the "event". This argument is only applicable when estimator = "binary". The default is "first". #' @returns A tibble with columns .metric, .estimator, and .estimate and 1 row of values. #' For grouped data frames, the number of rows returned will be the same as the diff --git a/R/tss_max.R b/R/tss_max.R index d71de15e..3aac0856 100644 --- a/R/tss_max.R +++ b/R/tss_max.R @@ -14,11 +14,11 @@ #' and estimate arguments, or a table/matrix where the true class #' results should be in the columns of the table. #' @param ... A set of unquoted column names or one or more dplyr selector functions to choose which variables contain the class probabilities. If truth is binary, only 1 column should be selected, and it should correspond to the value of event_level. Otherwise, there should be as many columns as factor levels of truth and the ordering of the columns should be the same as the factor levels of truth. -#' @param truth The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For ⁠_vec()⁠ functions, a factor vector. +#' @param truth The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a factor vector. #' @param estimator One of "binary", "hand_till", "macro", or "macro_weighted" to specify the type of averaging to be done. "binary" is only relevant for the two class case. The others are general methods for calculating multiclass metrics. The default will automatically choose "binary" if truth is binary, "hand_till" if truth has >2 levels and case_weights isn't specified, or "macro" if truth has >2 levels and case_weights is specified (in which case "hand_till" isn't well-defined). #' @param na_rm A logical value indicating whether NA values should be stripped before the computation proceeds. #' @param event_level A single string. Either "first" or "second" to specify which level of truth to consider as the "event". This argument is only applicable when estimator = "binary". The default uses an internal helper that generally defaults to "first" -#' @param case_weights The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For ⁠_vec()⁠ functions, a numeric vector. +#' @param case_weights The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For _vec() functions, a numeric vector. #' @param estimate If truth is binary, a numeric vector of class probabilities corresponding to the "relevant" class. Otherwise, a matrix with as many columns as factor levels of truth. It is assumed that these are in the same order as the levels of truth. #' @returns A tibble with columns .metric, .estimator, and .estimate and 1 row of values. #' For grouped data frames, the number of rows returned will be the same as the diff --git a/cran_comments.md b/cran_comments.md new file mode 100644 index 00000000..8f9b34d2 --- /dev/null +++ b/cran_comments.md @@ -0,0 +1,28 @@ +This is a new package not present on CRAN yet. + +On all testing environment (see below), we only get a note because of the +package being a new submission, and a false positive for mispelling +(paleoclimate is an existing word and is spelled correctly). + +## Test environments +- R-hub windows-x86_64-devel (r-devel) +- R-hub ubuntu-gcc-release (r-release) +- R-hub fedora-clang-devel (r-devel) +- devtools::check_mac_release + +## R CMD check results +On all systems: + +* checking CRAN incoming feasibility ... NOTE +Maintainer: ‘Andrea Manica ’ + +New submission + +Possibly misspelled words in DESCRIPTION: + Leonardi (9:6) + Tidymodels (2:41) + al (9:18) + et (9:15) + tidymodels (8:56) + +0 errors ✔ | 0 warnings ✔ | 1 notes ✖ \ No newline at end of file diff --git a/data-raw/helper_functions/submitting_to_cran.R b/data-raw/helper_functions/submitting_to_cran.R index ea039e64..c168421f 100644 --- a/data-raw/helper_functions/submitting_to_cran.R +++ b/data-raw/helper_functions/submitting_to_cran.R @@ -7,6 +7,9 @@ urlchecker::url_check() # enhanced local checks devtools::check(remote = TRUE, manual = TRUE) +# if unicode characters present and crashing latex +# grep --color='auto' -P -n "[^\x00-\x7F]" -r * + source("./data-raw/helper_functions/check_returns_in_documentation.R") diff --git a/man/blockcv2rsample.Rd b/man/blockcv2rsample.Rd index e6c643c8..1ace2f1d 100644 --- a/man/blockcv2rsample.Rd +++ b/man/blockcv2rsample.Rd @@ -28,7 +28,7 @@ sb1 <- cv_spatial( k = 5, # number of folds size = 350000, # size of the blocks in metres selection = "random", # random blocks-to-fold - iteration = 50 + iteration = 10 ) # find evenly dispersed folds sb1_rsample <- blockcv2rsample(sb1, pa_data) class(sb1_rsample) diff --git a/man/boyce_cont.Rd b/man/boyce_cont.Rd index 29744b16..e3c5ccfa 100644 --- a/man/boyce_cont.Rd +++ b/man/boyce_cont.Rd @@ -38,7 +38,7 @@ results should be in the columns of the table.} \item{...}{A set of unquoted column names or one or more dplyr selector functions to choose which variables contain the class probabilities. If truth is binary, only 1 column should be selected, and it should correspond to the value of event_level. Otherwise, there should be as many columns as factor levels of truth and the ordering of the columns should be the same as the factor levels of truth.} -\item{truth}{The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For ⁠_vec()⁠ functions, a factor vector.} +\item{truth}{The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a factor vector.} \item{estimator}{One of "binary", "hand_till", "macro", or "macro_weighted" to specify the type of averaging to be done. "binary" is only relevant for the two class case. The others are general methods for calculating multiclass metrics. The default will automatically choose "binary" if truth is binary, "hand_till" if truth has >2 levels and case_weights isn't specified, or "macro" if truth has >2 levels and case_weights is specified (in which case "hand_till" isn't well-defined).} @@ -46,7 +46,7 @@ results should be in the columns of the table.} \item{event_level}{A single string. Either "first" or "second" to specify which level of truth to consider as the "event". This argument is only applicable when estimator = "binary". The default uses an internal helper that generally defaults to "first"} -\item{case_weights}{The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For ⁠_vec()⁠ functions, a numeric vector.} +\item{case_weights}{The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For _vec() functions, a numeric vector.} \item{estimate}{If truth is binary, a numeric vector of class probabilities corresponding to the "relevant" class. Otherwise, a matrix with as many columns as factor levels of truth. It is assumed that these are in the same order as the levels of truth.} } diff --git a/man/kap_max.Rd b/man/kap_max.Rd index 013621b6..a6ea50f9 100644 --- a/man/kap_max.Rd +++ b/man/kap_max.Rd @@ -38,7 +38,7 @@ results should be in the columns of the table.} \item{...}{A set of unquoted column names or one or more dplyr selector functions to choose which variables contain the class probabilities. If truth is binary, only 1 column should be selected, and it should correspond to the value of event_level. Otherwise, there should be as many columns as factor levels of truth and the ordering of the columns should be the same as the factor levels of truth.} -\item{truth}{The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For ⁠_vec()⁠ functions, a factor vector.} +\item{truth}{The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a factor vector.} \item{estimator}{One of "binary", "hand_till", "macro", or "macro_weighted" to specify the type of averaging to be done. "binary" is only relevant for the two class case. The others are general methods for calculating multiclass metrics. The default will automatically choose "binary" if truth is binary, "hand_till" if truth has >2 levels and case_weights isn't specified, or "macro" if truth has >2 levels and case_weights is specified (in which case "hand_till" isn't well-defined).} @@ -46,7 +46,7 @@ results should be in the columns of the table.} \item{event_level}{A single string. Either "first" or "second" to specify which level of truth to consider as the "event". This argument is only applicable when estimator = "binary". The default uses an internal helper that generally defaults to "first"} -\item{case_weights}{The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For ⁠_vec()⁠ functions, a numeric vector.} +\item{case_weights}{The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For _vec() functions, a numeric vector.} \item{estimate}{If truth is binary, a numeric vector of class probabilities corresponding to the "relevant" class. Otherwise, a matrix with as many columns as factor levels of truth. It is assumed that these are in the same order as the levels of truth.} } diff --git a/man/optim_thresh.Rd b/man/optim_thresh.Rd index b0845e22..dd09a0f8 100644 --- a/man/optim_thresh.Rd +++ b/man/optim_thresh.Rd @@ -10,7 +10,7 @@ optim_thresh(truth, estimate, metric, event_level = "first") \item{truth}{The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column -names). For ⁠_vec()⁠ functions, a factor vector.} +names). For _vec() functions, a factor vector.} \item{estimate}{the predicted probability for the event} diff --git a/man/tss.Rd b/man/tss.Rd index c92d6c95..e8572d1c 100644 --- a/man/tss.Rd +++ b/man/tss.Rd @@ -25,15 +25,15 @@ results should be in the columns of the table.} \item{...}{Not currently used.} -\item{truth}{The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For ⁠_vec()⁠ functions, a factor vector.} +\item{truth}{The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a factor vector.} -\item{estimate}{The column identifier for the predicted class results (that is also factor). As with truth this can be specified different ways but the primary method is to use an unquoted variable name. For ⁠_vec()⁠ functions, a factor vector.} +\item{estimate}{The column identifier for the predicted class results (that is also factor). As with truth this can be specified different ways but the primary method is to use an unquoted variable name. For _vec() functions, a factor vector.} \item{estimator}{One of: "binary", "macro", "macro_weighted", or "micro" to specify the type of averaging to be done. "binary" is only relevant for the two class case. The other three are general methods for calculating multiclass metrics. The default will automatically choose "binary" or "macro" based on estimate.} \item{na_rm}{A logical value indicating whether NA values should be stripped before the computation proceeds.} -\item{case_weights}{The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For ⁠_vec()⁠ functions, a numeric vector.} +\item{case_weights}{The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For _vec() functions, a numeric vector.} \item{event_level}{A single string. Either "first" or "second" to specify which level of truth to consider as the "event". This argument is only applicable when estimator = "binary". The default is "first".} } diff --git a/man/tss_max.Rd b/man/tss_max.Rd index 993d19f4..5da9e9ca 100644 --- a/man/tss_max.Rd +++ b/man/tss_max.Rd @@ -38,7 +38,7 @@ results should be in the columns of the table.} \item{...}{A set of unquoted column names or one or more dplyr selector functions to choose which variables contain the class probabilities. If truth is binary, only 1 column should be selected, and it should correspond to the value of event_level. Otherwise, there should be as many columns as factor levels of truth and the ordering of the columns should be the same as the factor levels of truth.} -\item{truth}{The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For ⁠_vec()⁠ functions, a factor vector.} +\item{truth}{The column identifier for the true class results (that is a factor). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a factor vector.} \item{estimator}{One of "binary", "hand_till", "macro", or "macro_weighted" to specify the type of averaging to be done. "binary" is only relevant for the two class case. The others are general methods for calculating multiclass metrics. The default will automatically choose "binary" if truth is binary, "hand_till" if truth has >2 levels and case_weights isn't specified, or "macro" if truth has >2 levels and case_weights is specified (in which case "hand_till" isn't well-defined).} @@ -46,7 +46,7 @@ results should be in the columns of the table.} \item{event_level}{A single string. Either "first" or "second" to specify which level of truth to consider as the "event". This argument is only applicable when estimator = "binary". The default uses an internal helper that generally defaults to "first"} -\item{case_weights}{The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For ⁠_vec()⁠ functions, a numeric vector.} +\item{case_weights}{The optional column identifier for case weights. This should be an unquoted column name that evaluates to a numeric column in data. For _vec() functions, a numeric vector.} \item{estimate}{If truth is binary, a numeric vector of class probabilities corresponding to the "relevant" class. Otherwise, a matrix with as many columns as factor levels of truth. It is assumed that these are in the same order as the levels of truth.} }