diff --git a/.Rbuildignore b/.Rbuildignore index 5e7002cde0d3d0c313e16670c354202c777521ab..1ed837b655c74b7fbca27c426fe5a18b9f4c620b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,4 @@ .*\.gitlab-ci.yml$ #^tests$ ./.nfs* +^cran-comments\.md$ diff --git a/DESCRIPTION b/DESCRIPTION index 16274dcef3f758f14aa85079a12e3b0fe49cac84..28a2634ba0bf876f2f9b062e01d84238e7e08d81 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: 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. +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: diff --git a/R/AbsToProbs.R b/R/AbsToProbs.R index c36640d17526a0b000958620cebe2521fdb885fc..af7b616228489146a171cfc56615102effddea4a 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 0000000000000000000000000000000000000000..82ce8fb7791f8392b65c440e7a8e4394acf05854 --- /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/man/AbsToProbs.Rd b/man/AbsToProbs.Rd index bb4dc50de9240f0c7bdfb8244dd11495fad6d3e0..c4507a28e29d0cbb31b17abaebee0c4ffb279a92 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)) } -} diff --git a/vignettes/EnergyIndicators.Rmd b/vignettes/EnergyIndicators.Rmd index 1399044f2bde3617c56bfeaa56d874fd9a0ad487..222ba3829e2d4df3c2ade0be674b7414fab7bd4e 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) ```