From 9c2b0e69ab9929ed0a8e57d47bac559524bb8169 Mon Sep 17 00:00:00 2001 From: nperez Date: Wed, 5 May 2021 10:19:38 +0200 Subject: [PATCH 1/6] Fixes from CRAN --- .Rbuildignore | 1 + R/AbsToProbs.R | 6 ++---- cran-comments.md | 32 ++++++++++++++++++++++++++++++++ vignettes/EnergyIndicators.Rmd | 2 ++ 4 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 cran-comments.md diff --git a/.Rbuildignore b/.Rbuildignore index 5e7002c..1ed837b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,4 @@ .*\.gitlab-ci.yml$ #^tests$ ./.nfs* +^cran-comments\.md$ diff --git a/R/AbsToProbs.R b/R/AbsToProbs.R index c36640d..af7b616 100644 --- a/R/AbsToProbs.R +++ b/R/AbsToProbs.R @@ -82,9 +82,8 @@ CST_AbsToProbs <- function(data, start = NULL, end = NULL, #'@examples #'exp <- CSTools::lonlat_prec$data #'exp_probs <- AbsToProbs(exp) -#'\dontrun{ -#'data <- array(rnorm(5 * 2 * 61 * 2), -#' c(member = 5, sdate = 3, ftime = 214, lon = 2)) +#'data <- array(rnorm(5 * 2 * 61 * 1), +#' c(member = 5, sdate = 2, ftime = 61, lon = 1)) #'Dates <- c(seq(as.Date("01-05-2000", format = "%d-%m-%Y"), #' as.Date("30-06-2000", format = "%d-%m-%Y"), by = 'day'), #' seq(as.Date("01-05-2001", format = "%d-%m-%Y"), @@ -92,7 +91,6 @@ CST_AbsToProbs <- function(data, start = NULL, end = NULL, #' seq(as.Date("01-05-2002", format = "%d-%m-%Y"), #' as.Date("30-06-2002", format = "%d-%m-%Y"), by = 'day')) #'exp_probs <- AbsToProbs(exp, start = list(21, 4), end = list(21, 6)) -#'} #'@export AbsToProbs <- function(data, dates = NULL, start = NULL, end = NULL, time_dim = 'time', memb_dim = 'member', diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 0000000..82ce8fb --- /dev/null +++ b/cran-comments.md @@ -0,0 +1,32 @@ +## Resubmission + +### [5-5-2021] CRAN Comments + +> Please reduce the length of the title to less than 65 characters. + +> Please always write package names, software names and API (application programming interface) names in single quotes in title and description. e.g: 'CSTools' + +> If there are references describing the methods in your package, please add these in the description field of your DESCRIPTION file in the form +authors (year) +authors (year) +authors (year, ISBN:...) +or if those are not available: +with no space after 'doi:', 'arXiv:', 'https:' and angle brackets for auto-linking. +(If you want to add a title as well please put it in quotes: "Title") + +> \dontrun{} should only be used if the example really cannot be executed (e.g. because of missing additional software, missing API keys, ...) by the user. That's why wrapping examples in \dontrun{} adds the comment ('# Not run:') as a warning for the user. +Does not seem necessary. +Please unwrap the examples if they are executable in < 5 sec, or replace \dontrun{} with \donttest{}. + + +> Please always make sure to reset to user's options(), working directory or par() after you changed it in examples and vignettes and demos. +e.g.: inst/doc/EnergyIndicators.R + +... +oldpar <- par(no.readonly = TRUE) +... +par(mfrow=c(1,2)) +... +par(oldpar) + + diff --git a/vignettes/EnergyIndicators.Rmd b/vignettes/EnergyIndicators.Rmd index 1399044..222ba38 100644 --- a/vignettes/EnergyIndicators.Rmd +++ b/vignettes/EnergyIndicators.Rmd @@ -33,6 +33,7 @@ The `mean` and `sd` of the WPD can be employed to summarize the wind resource in ```{r} library(CSIndicators) set.seed(1) +oldpar <- par(no.readonly = TRUE) wind <- rweibull(n = 1000, shape = 2, scale = 6) WPD <- WindPowerDensity(wind) mean(WPD) @@ -68,6 +69,7 @@ par(mfrow=c(1, 3)) hist(wind, breaks = seq(0, 20)) hist(WCFI, breaks = seq(0, 1, 0.05), ylim = c(0, 500)) hist(WCFIII, breaks = seq(0, 1, 0.05), ylim = c(0, 500)) +par(oldpar) ``` -- GitLab From 9f8e83db05f3816d734e792edbd4b50519bf1108 Mon Sep 17 00:00:00 2001 From: nperez Date: Wed, 5 May 2021 15:59:36 +0200 Subject: [PATCH 2/6] Add references --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 16274dc..0d063c6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: CSIndicators -Title: Sectoral Indicators for Climate Services Based on Sub-Seasonal to Decadal Climate Predictions +Title: Sectoral Indicators for Climate Services Based on Climate Predictions Version: 0.0.1 Authors@R: c( person("Nuria", "Perez-Zanon", , "nuria.perez@bsc.es", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8568-3071")), @@ -9,7 +9,7 @@ Authors@R: c( person("Marcos", "Raül", , "raul.marcos@bsc.es", role = "ctb"), person("Palma", "Lluis", , "lluis.palma@bsc.es", role = "ctb"), person("BSC-CNS", role = "cph")) -Description: Set of generalised tools for the flexible computation of climate related indicators defined by the user. Each method represents a specific mathematical approach which is combined with the possibility to select an arbitrary time period to define the indicator. This enables a wide range of possibilities to tailor the most suitable indicator for each particular climate service application (agriculture, food security, energy, water management…). This package is intended for sub-seasonal, seasonal and decadal climate predictions, but its methods are also applicable to other time-scales, provided the dimensional structure of the input is maintained. Additionally, the outputs of the functions in this package are compatible with CSTools. This package was developed in the context of H2020 MED-GOLD (776467) and S2S4E (776787) projects. +Description: Set of generalised tools for the flexible computation of climate related indicators defined by the user. Each method represents a specific mathematical approach which is combined with the possibility to select an arbitrary time period to define the indicator. This enables a wide range of possibilities to tailor the most suitable indicator for each particular climate service application (agriculture, food security, energy, water management…). This package is intended for sub-seasonal, seasonal and decadal climate predictions, but its methods are also applicable to other time-scales, provided the dimensional structure of the input is maintained. Additionally, the outputs of the functions in this package are compatible with CSTools. This package was developed in the context of H2020 MED-GOLD (776467) and S2S4E (776787) projects. Lledó et al. (2019) . Kalmikov (2017) . Depends: R (>= 3.6.0) Imports: -- GitLab From 3ba3a1bc8696dbe43c0cc81367bb22ecf777b4f3 Mon Sep 17 00:00:00 2001 From: nperez Date: Wed, 5 May 2021 16:12:19 +0200 Subject: [PATCH 3/6] quotes --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0d063c6..dc50c35 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,7 +9,7 @@ Authors@R: c( person("Marcos", "Raül", , "raul.marcos@bsc.es", role = "ctb"), person("Palma", "Lluis", , "lluis.palma@bsc.es", role = "ctb"), person("BSC-CNS", role = "cph")) -Description: Set of generalised tools for the flexible computation of climate related indicators defined by the user. Each method represents a specific mathematical approach which is combined with the possibility to select an arbitrary time period to define the indicator. This enables a wide range of possibilities to tailor the most suitable indicator for each particular climate service application (agriculture, food security, energy, water management…). This package is intended for sub-seasonal, seasonal and decadal climate predictions, but its methods are also applicable to other time-scales, provided the dimensional structure of the input is maintained. Additionally, the outputs of the functions in this package are compatible with CSTools. This package was developed in the context of H2020 MED-GOLD (776467) and S2S4E (776787) projects. Lledó et al. (2019) . Kalmikov (2017) . +Description: Set of generalised tools for the flexible computation of climate related indicators defined by the user. Each method represents a specific mathematical approach which is combined with the possibility to select an arbitrary time period to define the indicator. This enables a wide range of possibilities to tailor the most suitable indicator for each particular climate service application (agriculture, food security, energy, water management…). This package is intended for sub-seasonal, seasonal and decadal climate predictions, but its methods are also applicable to other time-scales, provided the dimensional structure of the input is maintained. Additionally, the outputs of the functions in this package are compatible with 'CSTools'. This package was developed in the context of H2020 MED-GOLD (776467) and S2S4E (776787) projects. Lledó et al. (2019) . Kalmikov (2017) . Depends: R (>= 3.6.0) Imports: -- GitLab From f81f7f45ffb9cd6773f7838d72a189a33e00f5d0 Mon Sep 17 00:00:00 2001 From: nperez Date: Wed, 5 May 2021 16:24:22 +0200 Subject: [PATCH 4/6] New title remove kalmikov reference --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index dc50c35..0d24c06 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: CSIndicators -Title: Sectoral Indicators for Climate Services Based on Climate Predictions +Title: Climate services' indicators based on sub-seasonal to decadal predictions Version: 0.0.1 Authors@R: c( person("Nuria", "Perez-Zanon", , "nuria.perez@bsc.es", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8568-3071")), @@ -9,7 +9,7 @@ Authors@R: c( person("Marcos", "Raül", , "raul.marcos@bsc.es", role = "ctb"), person("Palma", "Lluis", , "lluis.palma@bsc.es", role = "ctb"), person("BSC-CNS", role = "cph")) -Description: Set of generalised tools for the flexible computation of climate related indicators defined by the user. Each method represents a specific mathematical approach which is combined with the possibility to select an arbitrary time period to define the indicator. This enables a wide range of possibilities to tailor the most suitable indicator for each particular climate service application (agriculture, food security, energy, water management…). This package is intended for sub-seasonal, seasonal and decadal climate predictions, but its methods are also applicable to other time-scales, provided the dimensional structure of the input is maintained. Additionally, the outputs of the functions in this package are compatible with 'CSTools'. This package was developed in the context of H2020 MED-GOLD (776467) and S2S4E (776787) projects. Lledó et al. (2019) . Kalmikov (2017) . +Description: Set of generalised tools for the flexible computation of climate related indicators defined by the user. Each method represents a specific mathematical approach which is combined with the possibility to select an arbitrary time period to define the indicator. This enables a wide range of possibilities to tailor the most suitable indicator for each particular climate service application (agriculture, food security, energy, water management…). This package is intended for sub-seasonal, seasonal and decadal climate predictions, but its methods are also applicable to other time-scales, provided the dimensional structure of the input is maintained. Additionally, the outputs of the functions in this package are compatible with 'CSTools'. This package was developed in the context of H2020 MED-GOLD (776467) and S2S4E (776787) projects. Lledó et al. (2019) . Depends: R (>= 3.6.0) Imports: -- GitLab From a23c2c7039798a13cc0476c557c6f16d2913a279 Mon Sep 17 00:00:00 2001 From: nperez Date: Wed, 5 May 2021 16:55:30 +0200 Subject: [PATCH 5/6] title case format --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0d24c06..28a2634 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: CSIndicators -Title: Climate services' indicators based on sub-seasonal to decadal predictions +Title: Climate Services' Indicators Based on Sub-Seasonal to Decadal Predictions Version: 0.0.1 Authors@R: c( person("Nuria", "Perez-Zanon", , "nuria.perez@bsc.es", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8568-3071")), -- GitLab From a73ea39585be142926d0bde53c118edef1257c62 Mon Sep 17 00:00:00 2001 From: nperez Date: Wed, 5 May 2021 17:27:44 +0200 Subject: [PATCH 6/6] run detools::document() --- man/AbsToProbs.Rd | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/man/AbsToProbs.Rd b/man/AbsToProbs.Rd index bb4dc50..c4507a2 100644 --- a/man/AbsToProbs.Rd +++ b/man/AbsToProbs.Rd @@ -41,9 +41,8 @@ The Cumulative Distribution Function of a forecast is used to obtain the probabi \examples{ exp <- CSTools::lonlat_prec$data exp_probs <- AbsToProbs(exp) -\dontrun{ -data <- array(rnorm(5 * 2 * 61 * 2), - c(member = 5, sdate = 3, ftime = 214, lon = 2)) +data <- array(rnorm(5 * 2 * 61 * 1), + c(member = 5, sdate = 2, ftime = 61, lon = 1)) Dates <- c(seq(as.Date("01-05-2000", format = "\%d-\%m-\%Y"), as.Date("30-06-2000", format = "\%d-\%m-\%Y"), by = 'day'), seq(as.Date("01-05-2001", format = "\%d-\%m-\%Y"), @@ -52,4 +51,3 @@ Dates <- c(seq(as.Date("01-05-2000", format = "\%d-\%m-\%Y"), as.Date("30-06-2002", format = "\%d-\%m-\%Y"), by = 'day')) exp_probs <- AbsToProbs(exp, start = list(21, 4), end = list(21, 6)) } -} -- GitLab