diff --git a/DESCRIPTION b/DESCRIPTION index 57b1ab7161f66500fe9dbd7bb4ed787b194eb98e..f8939a9d9cacee7aa3014b6b39785df55a66a232 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,10 +1,14 @@ Package: CSIndicators -Title: Sectorial Indicators for Climate Services from Sub-Seasonal Forecast to Decadal Predictions +Title: Sectoral Indicators for Climate Services Based on Sub-Seasonal to Decadal Climate Predictions Version: 0.0.1 Authors@R: c( - person("Núria", "Pérez-Zanón", , "nuria.perez@bsc.es", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8568-3071")), - person("Llorenç", "Lledó", , "llorenc.lledo@bsc.es", role = "aut")) -Description: The definition-based computation of the sectoral indicators for the Climate Service. + person("Nuria", "Perez-Zanon", , "nuria.perez@bsc.es", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8568-3071")), + person("Chou", "Chihchung", ,"chihchung.chou@bsc.es", role = "aut"), + person("Llorenç", "Lledó", , "llorenc.lledo@bsc.es", role = "aut"), + person("González-Reviriego", "Nube", , "nube.gonzalez@bsc.es", role = "ctb"), + person("Marcos", "Raül", , "raul.marcos@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. Depends: R (>= 3.6.0) Imports: diff --git a/R/PeriodMean.R b/R/PeriodMean.R index c63c5f05dfc19d323c15abad431fffe192670dce..fa3af031194e7a13f50acccdbcd7eee4eae1ca8c 100644 --- a/R/PeriodMean.R +++ b/R/PeriodMean.R @@ -19,6 +19,7 @@ #' #'@examples #'exp <- CSTools::lonlat_data$exp +#'exp$data <- CSTools::lonlat_data$exp$data[1, , 3, , 1, 1] #'SA <- CST_PeriodMean(exp) #' #'@export diff --git a/R/QThreshold.R b/R/QThreshold.R index 9549b93611f2da690d8c35a214337ad2960bb036..067c495bb9ffbaa32eeff9a5a9137739f37550c2 100644 --- a/R/QThreshold.R +++ b/R/QThreshold.R @@ -104,8 +104,8 @@ CST_QThreshold <- function(data, threshold, start = NULL, end = NULL, #'@importFrom ClimProjDiags Subset #'@examples #'threshold = 25 -#'data <- array(rnorm(25 * 3 * 20 * 2, mean = 26), -#' c(member = 25, sdate = 3, time = 20, lon = 2)) +#'data <- array(rnorm(5 * 3 * 20 * 2, mean = 26), +#' c(member = 5, sdate = 3, time = 20, lon = 2)) #'thres_q <- QThreshold(data, threshold) #'@export QThreshold <- function(data, threshold, dates = NULL, start = NULL, end = NULL, diff --git a/R/TotalTimeExceedingThreshold.R b/R/TotalTimeExceedingThreshold.R index 84d829c5e67eef14c76d6a02669e46293a1600b5..3792caf90c2a26aeb6bec10cc92d5f4ddcfc0af5 100644 --- a/R/TotalTimeExceedingThreshold.R +++ b/R/TotalTimeExceedingThreshold.R @@ -27,7 +27,7 @@ #'@import multiApply #'@examples #'exp <- CSTools::lonlat_data$exp -#'exp$data <- CSTools::lonlat_data$exp$data[1, 5, 3, 3, 1, 1] +#'exp$data <- CSTools::lonlat_data$exp$data[1, 1, 3, 3, 1, 1] #'DOT <- CST_TotalTimeExceedingThreshold(exp, threshold = 280) #'@export CST_TotalTimeExceedingThreshold <- function(data, threshold, op = '>', diff --git a/man/CST_PeriodMean.Rd b/man/CST_PeriodMean.Rd index 95b4a36560f33c5975460872cb09f4d55145371a..1beefc5ff32ff195ba184c46a9ed748cc4d70028 100644 --- a/man/CST_PeriodMean.Rd +++ b/man/CST_PeriodMean.Rd @@ -38,6 +38,7 @@ Providing temperature data, two agriculture indices can be obtain by using this } \examples{ exp <- CSTools::lonlat_data$exp +exp$data <- CSTools::lonlat_data$exp$data[1, , 3, , 1, 1] SA <- CST_PeriodMean(exp) } diff --git a/man/CST_TotalTimeExceedingThreshold.Rd b/man/CST_TotalTimeExceedingThreshold.Rd index 50124fe72818e7b3c0bf9f5abeca496e4a94ef57..e1d3c7ddfd08cdcc9a12dbe77d8952697dfcb40f 100644 --- a/man/CST_TotalTimeExceedingThreshold.Rd +++ b/man/CST_TotalTimeExceedingThreshold.Rd @@ -51,6 +51,6 @@ Providing maximum temperature daily data, the following agriculture indices for } \examples{ exp <- CSTools::lonlat_data$exp -exp$data <- CSTools::lonlat_data$exp$data[1, 5, 3, 3, 1, 1] +exp$data <- CSTools::lonlat_data$exp$data[1, 1, 3, 3, 1, 1] DOT <- CST_TotalTimeExceedingThreshold(exp, threshold = 280) } diff --git a/man/QThreshold.Rd b/man/QThreshold.Rd index 8f55badb94c1120165ccda35cb6dbbd10ce17963..ff4900ebef82fa930dae133c3ec1f5dff420cb82 100644 --- a/man/QThreshold.Rd +++ b/man/QThreshold.Rd @@ -52,7 +52,7 @@ The sample used will depend on the dimensions of the data provided and the dimen } \examples{ threshold = 25 -data <- array(rnorm(25 * 3 * 20 * 2, mean = 26), - c(member = 25, sdate = 3, time = 20, lon = 2)) +data <- array(rnorm(5 * 3 * 20 * 2, mean = 26), + c(member = 5, sdate = 3, time = 20, lon = 2)) thres_q <- QThreshold(data, threshold) }