From 84fffb3018f02f2d886de210a42a823eb450bebf Mon Sep 17 00:00:00 2001 From: aho Date: Fri, 11 Aug 2023 12:33:19 +0200 Subject: [PATCH 1/9] Create issue template --- .gitlab/issue_templates/Default.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .gitlab/issue_templates/Default.md diff --git a/.gitlab/issue_templates/Default.md b/.gitlab/issue_templates/Default.md new file mode 100644 index 0000000..ae1bfe9 --- /dev/null +++ b/.gitlab/issue_templates/Default.md @@ -0,0 +1,26 @@ +(This is a template to report problems or suggest a new development. Please fill in the relevant information and remove the rest.) + +Hi @aho (and @erifarov), + +#### Summary +(Bug: Summarize the bug and explain briefly the expected and the current behavior.) +(New development: Summarize the development needed.) + +#### Example +(Bug: Provide a **minimal reproducible example** and the error message. See [How To Build A Minimal Reproducible Example](https://docs.google.com/document/d/1zRlmsRwFDJctDB94x6HGf6ezu3HFHhEjaBu0hVcrwTI/edit#heading=h.skblym4acpw5)) +(New development: Provide an example script or useful piece of code if appliable.) + +```r +#Example: +exp <- WeightedMean(...) +``` +> Error in WeightedMean: &%$("!* + +#### Module and Package Version +(Which R version are you using? e.g., R/4.1.2) +(What other modules and their versions required to reproduce this issue? e.g., PROJ/4.8.0-foss-2015a) +(Which R package versions are you using? Check with sessionInfo(). e.g., s2dv_1.4.1) +(Which machine are you using? WS, Nord3, hub, others...) + +#### Other Relevant Information +(Additional information, e.g., the plots.) -- GitLab From e1fc5082eab87c01a74c6c0500f2c7b7aeb0c7b7 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Wed, 11 Oct 2023 11:32:18 +0200 Subject: [PATCH 2/9] Update unit tests --- tests/testthat/test-Lon2index.R | 2 +- tests/testthat/test-Selbox.R | 18 +++++++++--------- tests/testthat/test-ShiftLon.R | 2 +- tests/testthat/test-Subset.R | 6 +++--- tests/testthat/test-WeightedCells.R | 2 +- tests/testthat/test-WeightedMean.R | 18 +++++++++--------- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/testthat/test-Lon2index.R b/tests/testthat/test-Lon2index.R index 8f53079..e435dee 100644 --- a/tests/testthat/test-Lon2index.R +++ b/tests/testthat/test-Lon2index.R @@ -1,4 +1,4 @@ -context("Generic tests") + test_that("Sanity checks", { expect_error(Lon2Index(lon = NULL), "Parameter 'lon' cannot be NULL.") expect_error(Lon2Index(lon = 'a'), "Parameter 'lon' must be numeric.") diff --git a/tests/testthat/test-Selbox.R b/tests/testthat/test-Selbox.R index fce7f06..1b7b5a9 100644 --- a/tests/testthat/test-Selbox.R +++ b/tests/testthat/test-Selbox.R @@ -1,4 +1,4 @@ -context("ClimProjDiags::SelBox tests") + ############################################## @@ -73,8 +73,8 @@ test_that("1. Input checks", { expect_warning( SelBox(array(1:10, dim = c(lon = 10, lat = 1)), region = region, lon = 1:10, lat = 1, londim = 1, latdim = 2), - "Numeric 'londim' is deprecated, use dimension names instead. The ", - "corresponding dimension name will be assigned." + paste0("Numeric 'londim' is deprecated, use dimension names instead. The ", + "corresponding dimension name will be assigned.") ) expect_error( SelBox(array(1:10, dim = c(lon = 10, lat = 1)), region = region, @@ -84,8 +84,8 @@ test_that("1. Input checks", { expect_warning( SelBox(array(1:10, dim = c(lon = 10, lat = 1)), region = region, lon = 1:10, lat = 1, londim = c('lon', 'lat'), latdim = 'lat'), - "Parameter 'londim' must be of length 1. Only the first value ", - "will be used." + paste0("Parameter 'londim' must be of length 1. Only the first value ", + "will be used.") ) expect_error( SelBox(array(1:10, dim = c(lons = 10, lat = 1)), region = region, @@ -102,8 +102,8 @@ test_that("1. Input checks", { expect_warning( SelBox(array(1:10, dim = c(lon = 10, lat = 1)), region = region, lon = 1:10, lat = 1, latdim = 2), - "Numeric 'latdim' is deprecated, use dimension names instead. The ", - "corresponding dimension name will be assigned." + paste0("Numeric 'latdim' is deprecated, use dimension names instead. The ", + "corresponding dimension name will be assigned.") ) expect_error( SelBox(array(1:10, dim = c(lon = 10, lat = 1)), region = region, @@ -113,8 +113,8 @@ test_that("1. Input checks", { expect_warning( SelBox(array(1:10, dim = c(lon = 10, lat = 1)), region = region, lon = 1:10, lat = 1, latdim = c('lat', 'lon')), - "Parameter 'latdim' must be of length 1. Only the first value ", - "will be used." + paste0("Parameter 'latdim' must be of length 1. Only the first value ", + "will be used.") ) expect_error( SelBox(array(1:10, dim = c(lon = 10, lats = 1)), region = region, diff --git a/tests/testthat/test-ShiftLon.R b/tests/testthat/test-ShiftLon.R index e414b5c..99b81e5 100644 --- a/tests/testthat/test-ShiftLon.R +++ b/tests/testthat/test-ShiftLon.R @@ -1,4 +1,4 @@ -context("ShiftLon tests") + ############################################## diff --git a/tests/testthat/test-Subset.R b/tests/testthat/test-Subset.R index 8144f96..f9ec418 100644 --- a/tests/testthat/test-Subset.R +++ b/tests/testthat/test-Subset.R @@ -1,4 +1,4 @@ -context("Subset tests") + dat1 <- array(1:20, dim = c(dat = 1, lat = 2, lon = 10)) @@ -249,7 +249,7 @@ test_that("4. dat3", { expect_equal( Subset(dat1, 'dat', 1, drop = FALSE), Subset(dat3, 'dat', 1, drop = FALSE), -check.attributes = F +ignore_attr = T ) expect_equal( attributes(Subset(dat3, 'dat', 1, drop = FALSE)), @@ -270,7 +270,7 @@ list(dim = c(10), dimensions = c('lon')) expect_equal( Subset(dat1, c('lat', 'lon'), list(1, 2), drop = TRUE), Subset(dat3, c('lat', 'lon'), list(1, 2), drop = TRUE), -check.attributes = F +ignore_attr = T ) expect_equal( attributes(Subset(dat3, c('lat', 'lon'), list(1, 2), drop = TRUE)), diff --git a/tests/testthat/test-WeightedCells.R b/tests/testthat/test-WeightedCells.R index a5e9dd1..8f771f4 100644 --- a/tests/testthat/test-WeightedCells.R +++ b/tests/testthat/test-WeightedCells.R @@ -1,4 +1,4 @@ -context("ClimProjDiags::WeightedCells tests") + ############################################## diff --git a/tests/testthat/test-WeightedMean.R b/tests/testthat/test-WeightedMean.R index 3edfcae..4309710 100644 --- a/tests/testthat/test-WeightedMean.R +++ b/tests/testthat/test-WeightedMean.R @@ -1,4 +1,4 @@ -context("ClimProjDiags::WeightedMean tests") + ############################################## @@ -63,8 +63,8 @@ test_that("1. Input checks", { expect_warning( WeightedMean(array(1:10, dim = c(lon = 10, lat = 1)), lon = 1:10, lat = 1, londim = 1, latdim = 2), - "Numeric 'londim' is deprecated, use dimension names instead. The ", - "corresponding dimension name will be assigned." + paste0("Numeric 'londim' is deprecated, use dimension names instead. The ", + "corresponding dimension name will be assigned.") ) expect_error( WeightedMean(array(1:10, dim = c(lon = 10, lat = 1)), @@ -74,8 +74,8 @@ test_that("1. Input checks", { expect_warning( WeightedMean(array(1:10, dim = c(lon = 10, lat = 1)), lon = 1:10, lat = 1, londim = c('lon', 'lat'), latdim = 'lat'), - "Parameter 'londim' must be of length 1. Only the first value ", - "will be used." + paste0("Parameter 'londim' must be of length 1. Only the first value ", + "will be used.") ) expect_error( WeightedMean(array(1:10, dim = c(lons = 10, lat = 1)), @@ -92,8 +92,8 @@ test_that("1. Input checks", { expect_warning( WeightedMean(array(1:10, dim = c(lon = 10, lat = 1)), lon = 1:10, lat = 1, latdim = 2), - "Numeric 'latdim' is deprecated, use dimension names instead. The ", - "corresponding dimension name will be assigned." + paste0("Numeric 'latdim' is deprecated, use dimension names instead. The ", + "corresponding dimension name will be assigned.") ) expect_error( WeightedMean(array(1:10, dim = c(lon = 10, lat = 1)), @@ -103,8 +103,8 @@ test_that("1. Input checks", { expect_warning( WeightedMean(array(1:10, dim = c(lon = 10, lat = 1)), lon = 1:10, lat = 1, latdim = c('lat', 'lon')), - "Parameter 'latdim' must be of length 1. Only the first value ", - "will be used." + paste0("Parameter 'latdim' must be of length 1. Only the first value ", + "will be used.") ) expect_error( WeightedMean(array(1:10, dim = c(lon = 10, lats = 1)), -- GitLab From 2329fb1d17edc55fdf014ede3ac542924486ea5b Mon Sep 17 00:00:00 2001 From: aho Date: Thu, 21 Dec 2023 16:12:57 +0100 Subject: [PATCH 3/9] Fix dimension when drop = T and the remaining dimension is one with length > 1 --- R/Subset.R | 3 ++- tests/testthat/test-Subset.R | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/R/Subset.R b/R/Subset.R index d9cb384..75b7221 100644 --- a/R/Subset.R +++ b/R/Subset.R @@ -136,7 +136,8 @@ Subset <- function(x, along, indices, drop = FALSE) { if (!identical(dim_names, character(0))) { # If there is one dim left, subset won't have dimension (but it should # have one). Add it back. - dim(subset) <- dim(x)[dim_names] + subset <- array(subset, dim = length(subset)) + names(dim(subset)) <- dim_names } else { # a number left dim(subset) <- 1 } diff --git a/tests/testthat/test-Subset.R b/tests/testthat/test-Subset.R index f9ec418..872693e 100644 --- a/tests/testthat/test-Subset.R +++ b/tests/testthat/test-Subset.R @@ -279,3 +279,18 @@ list(dim = 1, dimensions = c('dat', 'lat', 'lon')) }) +test_that("5. drop = T", { +arr <- array(1:3, dim = c(dat = 1, var = 1, sdate = 3)) + +expect_equal( +dim(Subset(arr, "sdate", 1:2, drop = T)), +c(sdate = 2) +) + +expect_equal( +dim(Subset(arr, "sdate", 2, drop = T)), +1 +) + +}) + -- GitLab From f6557baa1905e66e6558c645c6ad34612c422611 Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Tue, 23 Jan 2024 16:18:33 +0100 Subject: [PATCH 4/9] Version bump 0.3.3 --- DESCRIPTION | 2 +- NEWS.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index fa83573..acef490 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ClimProjDiags Title: Set of Tools to Compute Various Climate Indices -Version: 0.3.2 +Version: 0.3.3 Authors@R: c( person("BSC-CNS", role = c("aut", "cph")), person("Nuria", "Perez-Zanon", , "nuria.perez@bsc.es", role = c("aut"), comment = c(ORCID = "0000-0001-8568-3071")), diff --git a/NEWS.md b/NEWS.md index 45f9e05..6e7949c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# 0.3.3 (Release date: 2024-01-24) +- Bugfix in Subset() for drop = T, didn't have correct given output dimension therefore returned error. It happened when the output dimension is 1 and the length is > 1. + # 0.3.2 (Release date: 2023-06-01) - Remove climdex.pcic dependency -- GitLab From 18c73e41136074187cba438f3ffd1075d233109a Mon Sep 17 00:00:00 2001 From: Eva Rifa Date: Wed, 24 Jan 2024 10:48:47 +0100 Subject: [PATCH 5/9] Updated DESCRIPTION roxygenNote version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index acef490..96f7dc1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -32,6 +32,6 @@ License: GPL-3 URL: https://earth.bsc.es/gitlab/es/ClimProjDiags BugReports: https://earth.bsc.es/gitlab/es/ClimProjDiags/-/issues Encoding: UTF-8 -RoxygenNote: 7.2.0 +RoxygenNote: 7.2.3 VignetteBuilder: knitr Config/testthat/edition: 3 -- GitLab From 78451aba92c21099731040eb716b16bea496ede4 Mon Sep 17 00:00:00 2001 From: vagudets Date: Wed, 24 Jan 2024 11:35:02 +0100 Subject: [PATCH 6/9] Update DESCRIPTION --- DESCRIPTION | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 96f7dc1..5818d85 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,8 +3,9 @@ Title: Set of Tools to Compute Various Climate Indices Version: 0.3.3 Authors@R: c( person("BSC-CNS", role = c("aut", "cph")), + person("Victòria", "Agudetse", , "victoria.agudetse@bsc.es", role = c("cre")), person("Nuria", "Perez-Zanon", , "nuria.perez@bsc.es", role = c("aut"), comment = c(ORCID = "0000-0001-8568-3071")), - person("An-Chi", "Ho", , "an.ho@bsc.es", role = c("cre", "ctb")), + person("An-Chi", "Ho", , "an.ho@bsc.es", role = c("ctb")), person("Nicolau", "Manubens", , "nicolau.manubens@bsc.es", role = "ctb"), person("Alasdair", "Hunter", , "alasdair.hunter@bsc.es", role = "aut"), person("Louis-Philippe", "Caron", , "louis-philippe.caron@bsc.es", role = "ctb"), @@ -32,6 +33,6 @@ License: GPL-3 URL: https://earth.bsc.es/gitlab/es/ClimProjDiags BugReports: https://earth.bsc.es/gitlab/es/ClimProjDiags/-/issues Encoding: UTF-8 -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 VignetteBuilder: knitr Config/testthat/edition: 3 -- GitLab From e4697cd21f2e5c7705901ab00c34b80f2f841650 Mon Sep 17 00:00:00 2001 From: EVA RIFA ROVIRA Date: Wed, 24 Jan 2024 15:18:40 +0100 Subject: [PATCH 7/9] Update documentation; .Rbuildignore --- .Rbuildignore | 1 + R/AnoAgree.R | 17 ++++++++++----- R/ArrayToList.R | 15 +++++++++---- R/Climdex.R | 8 +++---- R/CombineIndices.R | 24 ++++++++++++++------ R/DTRIndicator.R | 51 ++++++++++++++++++++++++++++++++----------- R/DTRRef.R | 45 ++++++++++++++++++++++++++++---------- R/DailyAno.R | 16 +++++++++----- R/Extremes.R | 14 +++++++----- R/Lon2Index.R | 12 ++++++---- R/SeasonSelect.R | 27 +++++++++++++++++------ R/SelBox.R | 25 +++++++++++---------- R/Threshold.R | 28 +++++++++++++++--------- R/WaveDuration.R | 16 ++++++++------ man/AnoAgree.Rd | 17 ++++++++++----- man/ArrayToList.Rd | 15 +++++++++---- man/Climdex.Rd | 8 +++---- man/CombineIndices.Rd | 24 ++++++++++++++------ man/DTRIndicator.Rd | 51 ++++++++++++++++++++++++++++++++----------- man/DTRRef.Rd | 45 ++++++++++++++++++++++++++++---------- man/DailyAno.Rd | 16 +++++++++----- man/Extremes.Rd | 14 +++++++----- man/Lon2Index.Rd | 12 ++++++---- man/SeasonSelect.Rd | 27 +++++++++++++++++------ man/SelBox.Rd | 25 +++++++++++---------- man/Threshold.Rd | 28 +++++++++++++++--------- man/WaveDuration.Rd | 16 ++++++++------ 27 files changed, 405 insertions(+), 192 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index dde50c4..fd5f708 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,5 +1,6 @@ .*\.git$ .*\.gitignore$ +.*\.gitlab$ .*\.tar.gz$ .*\.pdf$ ./.nc$ diff --git a/R/AnoAgree.R b/R/AnoAgree.R index 4212039..fd2d1f1 100644 --- a/R/AnoAgree.R +++ b/R/AnoAgree.R @@ -1,13 +1,19 @@ -#'Percentage of anomalies which agrees with the sign of the mean anomaly for multidimensional arrays +#'Percentage of anomalies which agrees with the sign of the mean anomaly for +#'multidimensional arrays #' -#'@description This function computes the mean and the percentage of agreement between anomalies. +#'@description This function computes the mean and the percentage of agreement +#'between anomalies. #' #'@param ano A multidimensional array. #'@param membersdim The dimension in which models are stored. -#'@param na.rm A logical indicating whether missing values should be removed. If \code{na.rm} is FALSE an NA value in any of the arguments will cause a value of NA to be returned, otherwise (TRUE by default) NA values are ignored. +#'@param na.rm A logical indicating whether missing values should be removed. If +#' \code{na.rm} is FALSE an NA value in any of the arguments will cause a value +#' of NA to be returned, otherwise (TRUE by default) NA values are ignored. #'@param ncores The number of cores to be used when computing the agreement. #' -#'@return An array of one dimension less than the \code{ano} object, except for one dimensional arrays or vectors, for which an array of dimension 1 called 'var' is returned. +#'@return An array of one dimension less than the \code{ano} object, except for +#'one dimensional arrays or vectors, for which an array of dimension 1 called +#''var' is returned. #' #'@import multiApply #'@examples @@ -16,7 +22,8 @@ #'for(i in 1:20) { a <- c(a, rnorm(6)) } #'dim(a) <- c(lat = 2, lon = 3, var = 4, mod = 5) #' -#'agree <- AnoAgree(ano = a, membersdim = which(names(dim(a)) == 'mod'), na.rm = TRUE, ncores = NULL) +#'agree <- AnoAgree(ano = a, membersdim = which(names(dim(a)) == 'mod'), +#' na.rm = TRUE, ncores = NULL) #'print(agree) #' #'a <- rnorm(6) diff --git a/R/ArrayToList.R b/R/ArrayToList.R index e99855e..a36de39 100644 --- a/R/ArrayToList.R +++ b/R/ArrayToList.R @@ -1,11 +1,18 @@ #' Split an array into list by a given array dimension #' -#'@description This function splits an array into a list as required by PlotLayout function from package "s2dv" when parameter 'special_args' is used. The function ArrayToList allows to add names to the elements of the list in two different levels, the 'list' or the 'sublist'. +#'@description This function splits an array into a list as required by +#'PlotLayout function from package "s2dv" when parameter 'special_args' is used. +#'The function ArrayToList allows to add names to the elements of the list in +#'two different levels, the 'list' or the 'sublist'. #' #'@param data A multidimensional array. -#'@param dim A character string indicating the name of the dimension to split or an integer indicating the position of the dimension. -#'@param level A string character 'list' or 'sublist' indicating if it should be a list or a sublist. By default it creates a list. -#'@param names A vector of character strings to name the list (if it is a single string, it would be reused) or a single character string to name the elements in the sublist. +#'@param dim A character string indicating the name of the dimension to split or +#' an integer indicating the position of the dimension. +#'@param level A string character 'list' or 'sublist' indicating if it should be +#' a list or a sublist. By default it creates a list. +#'@param names A vector of character strings to name the list (if it is a single +#' string, it would be reused) or a single character string to name the +#' elements in the sublist. #' #'@return A list of arrays of the length of the dimension set in parameter 'dim'. #' diff --git a/R/Climdex.R b/R/Climdex.R index 74da904..a3e6ea7 100644 --- a/R/Climdex.R +++ b/R/Climdex.R @@ -23,10 +23,10 @@ #' #'@return A list of length 2: #'\itemize{ -#' \item\code{$result} {An array with the same dimensions as the input array, -#' except for the temporal dimension which is renamed to 'year', moved to the -#' first dimension position and reduce to annual resolution.} -#' \item\code{$years} {A vector of the corresponding years.} +#' \item{\code{$result}, an array with the same dimensions as the input array, +#' except for the temporal dimension which is renamed to 'year', moved +#' to the first dimension position and reduce to annual resolution.} +#' \item{\code{$years}, a vector of the corresponding years.} #'} #' #'@import multiApply diff --git a/R/CombineIndices.R b/R/CombineIndices.R index 05f04c9..2ae17bb 100644 --- a/R/CombineIndices.R +++ b/R/CombineIndices.R @@ -1,25 +1,35 @@ #'Combine weighted indices of n-dimensional arrays #' -#'@description Function to combine climate indices for multiple models through addition, subtraction, division or averaging, optionally applying weights to each index. +#'@description Function to combine climate indices for multiple models through +#'addition, subtraction, division or averaging, optionally applying weights to +#'each index. #' -#'@param indices List of n-dimensional arrays with equal dimensions to be combined. -#'@param weights Vector of weights for the indices, whose length is the same as the list of parameter \code{indices}. If not provided, a weight of 1 is assigned to each index. If \code{operation = 'mean'} the weights are normalized to sum 1 all together. -#'@param operation The operation for combining the indices, either \code{"mean"} (default), \code{"add"}, \code{"subtract"} or \code{"divide"}. +#'@param indices List of n-dimensional arrays with equal dimensions to be +#' combined. +#'@param weights Vector of weights for the indices, whose length is the same as +#' the list of parameter \code{indices}. If not provided, a weight of 1 is +#' assigned to each index. If \code{operation = 'mean'} the weights are +#' normalized to sum 1 all together. +#'@param operation The operation for combining the indices, either \code{"mean"} +#' (default), \code{"add"}, \code{"subtract"} or \code{"divide"}. #' -#'@return An array of the same dimensions as one of the elements in the parameter \code{indices}. +#'@return An array of the same dimensions as one of the elements in the +#'parameter \code{indices}. #' #'@examples #'a <- matrix(rnorm(6), 2, 3) #'b <- matrix(rnorm(6), 2, 3) #' -#'comb_ind <- CombineIndices(indices = list(a, b), weights = c(2, 1), operation = "add") +#'comb_ind <- CombineIndices(indices = list(a, b), weights = c(2, 1), +#' operation = "add") #'print(comb_ind) #' #'a <- rnorm(24) #'dim(a) <- c(lon = 2, lat = 3, mod = 4) #'b <- rnorm(24) #'dim(b) <- c(lon = 2, lat = 3, mod = 4) -#'comb_ind <- CombineIndices(indices = list(a, b), weights = c(2, 1), operation = "add") +#'comb_ind <- CombineIndices(indices = list(a, b), weights = c(2, 1), +#' operation = "add") #'print(comb_ind) #'@export CombineIndices <- function(indices, weights = NULL, operation = "mean") { diff --git a/R/DTRIndicator.R b/R/DTRIndicator.R index 7f32b9c..0c27723 100644 --- a/R/DTRIndicator.R +++ b/R/DTRIndicator.R @@ -1,21 +1,43 @@ #'Diurnal temperature range indicator (DTR) of multidimensional arrays #' -#'@description This function computes the diurnal temperature indicator, defined as the number of days where the diurnal temperature variation exceeds the vulnerability threshold (defined as the mean(tmax -tmin) + 5 from the reference period). +#'@description This function computes the diurnal temperature indicator, defined +#'as the number of days where the diurnal temperature variation exceeds the +#'vulnerability threshold (defined as the mean(tmax -tmin) + 5 from the +#'reference period). #' -#'@param tmax A numeric multidimensional array containing daily maximum temperature. -#'@param tmin A numeric multidimensional array containing daily minimum temperature. This array must be the same dimensions as \code{tmax} parameter. -#'@param ref An output list from the \code{DTRRef} function with the same dimensions as parameters \code{tmax} and \code{tmin}, except the time dimension, containing the mean diurnal temperature variation for the reference period. -#'@param by.seasons If TRUE (by default), the DTR is computed for each season (December-January-February, March-April-May, June-July-August and September-October-November) seperately. If FALSE is specified, the montly mean DTR is computed. -#'@param dates A vector of dates with a calendar attributes. If NULL (by default), the 'time' attributes of parameter 'tmax' and 'tmin' are considered. -#'@param timedim An integer number indicating the position of the time dimension in the parameters \code{tmax} and \code{tmin}. If NULL (by default), the dimension called 'time' in parameter \code{tmax} and \code{tmin} is considered as time dimension. +#'@param tmax A numeric multidimensional array containing daily maximum +#' temperature. +#'@param tmin A numeric multidimensional array containing daily minimum +#' temperature. This array must be the same dimensions as \code{tmax} +#' parameter. +#'@param ref An output list from the \code{DTRRef} function with the same +#' dimensions as parameters \code{tmax} and \code{tmin}, except the time +#' dimension, containing the mean diurnal temperature variation for the +#' reference period. +#'@param by.seasons If TRUE (by default), the DTR is computed for each season +#' (December-January-February, March-April-May, June-July-August and +#' September-October-November) seperately. If FALSE is specified, the montly +#' mean DTR is computed. +#'@param dates A vector of dates with a calendar attributes. If NULL (by +#' default), the 'time' attributes of parameter 'tmax' and 'tmin' are +#' considered. +#'@param timedim An integer number indicating the position of the time dimension +#' in the parameters \code{tmax} and \code{tmin}. If NULL (by default), the +#' dimension called 'time' in parameter \code{tmax} and \code{tmin} is +#' considered as time dimension. #'@param calendar A character indicating the calendar type. #'@param ncores The number of cores to be used when computing the index. #' #'@return A list of length 3: #'\itemize{ -#'\item\code{$dtr.ref}{An array with the same dimensions as the input \code{data}, but with the time dimension reduce from daily to monthly or seasonal resolution depending on the selected resolution in \code{by.season}.} -#'\item\code{$year}{A vector of the corresponding years.} -#'\item\code{$season}{A vector of the seasons or months corresponding to the resolution selected in \code{by.season}}} +#' \item{\code{$dtr.ref}, an array with the same dimensions as the input +#' \code{data}, but with the time dimension reduce from daily to monthly +#' or seasonal resolution depending on the selected resolution in +#' \code{by.season}.} +#' \item{\code{$year}, a vector of the corresponding years.} +#' \item{\code{$season}, a vector of the seasons or months corresponding to the +#' resolution selected in \code{by.season}.} +#'} #' #'@import multiApply #'@examples @@ -24,12 +46,15 @@ #'dim(tmax) <- c(lon = 2, lat = 3, time = 730, model = 1) #'tmin <- (1 : (2 * 3 * 730 * 1)) - 1 #'dim(tmin) <- c(lon = 2, lat = 3, time = 730, model = 1) -#'time <- seq(as.POSIXct("1900-01-01 12:00:00", tz = "", format = "%Y-%d-%m %H:%M:%S"), -#' as.POSIXct("1901-31-12 18:00:00", tz = "", format = "%Y-%d-%m %H:%M:%S"), "day") +#'time <- seq(as.POSIXct("1900-01-01 12:00:00", tz = "", +#' format = "%Y-%d-%m %H:%M:%S"), +#' as.POSIXct("1901-31-12 18:00:00", tz = "", +#' format = "%Y-%d-%m %H:%M:%S"), "day") #'time <- as.POSIXct(time, tz = "CET") #'metadata <- list(time = list(standard_name = 'time', long_name = 'time', #' calendar = 'noleap', -#' units = 'days since 1970-01-01 00:00:00', prec = 'double', +#' units = 'days since 1970-01-01 00:00:00', +#' prec = 'double', #' dim = list(list(name ='time', unlim = FALSE)))) #'attr(time, "variables") <- metadata #'attr(tmax, 'Variables')$dat1$time <- time diff --git a/R/DTRRef.R b/R/DTRRef.R index f275ddc..fb6e964 100644 --- a/R/DTRRef.R +++ b/R/DTRRef.R @@ -1,22 +1,41 @@ #'Diurnal temperature range of multidimensional arrays #' -#'@description This function computes the mean diurnal temperature range (tmax - tmin). +#'@description This function computes the mean diurnal temperature range +#'(tmax - tmin). #' -#'@param tmax A numeric multidimensional array containing daily maximum temperature. -#'@param tmin A numeric multidimensional array containing daily minimum temperature. -#'@param by.seasons If TRUE (by default), the DTR is computed for each season (December-January-February, March-April-May, June-July-August and September-October-November) seperately. If FALSE is specified, the montly mean DTR is computed. -#'@param dates A vector of dates with a calendar attributes. If NULL (by default), the 'time' attributes of parameter 'tmax' and 'tmin' are considered. -#'@param timedim An integer number indicating the position of the time dimension in the parameters \code{tmax} and \code{tmin}. If NULL (by default), the dimension called 'time' in parameter \code{tmax} and \code{tmin} is considered as time dimension. +#'@param tmax A numeric multidimensional array containing daily maximum +#' temperature. +#'@param tmin A numeric multidimensional array containing daily minimum +#' temperature. +#'@param by.seasons If TRUE (by default), the DTR is computed for each season +#' (December-January-February, March-April-May, June-July-August and +#' September-October-November) seperately. If FALSE is specified, the montly +#' mean DTR is computed. +#'@param dates A vector of dates with a calendar attributes. If NULL (by +#' default), the 'time' attributes of parameter 'tmax' and 'tmin' are +#' considered. +#'@param timedim An integer number indicating the position of the time dimension +#' in the parameters \code{tmax} and \code{tmin}. If NULL (by default), the +#' dimension called 'time' in parameter \code{tmax} and \code{tmin} is +#' considered as time dimension. #'@param calendar A character indicating the calendar type. -#'@param na.rm A logical indicating whether missing values should be removed. If \code{na.rm} is FALSE an NA value in any of the arguments will cause a value of NA to be returned, otherwise (TRUE by default) NA values are ignored. +#'@param na.rm A logical indicating whether missing values should be removed. If +#' \code{na.rm} is FALSE an NA value in any of the arguments will cause a value +#' of NA to be returned, otherwise (TRUE by default) NA values are ignored. #'@param ncores The number of cores to be used when computing the index. #' #'@return A list of length 2: #'\itemize{ -#'\item\code{$dtr.ref} {An array with the same dimensions as the input \code{data}, but with the time dimension reduce from daily to monthly or seasonal resolution depending on the selected resolution in \code{by.season}.} -#'\item\code{$season} {A vector of the season or months corresponding to the resolution selected in \code{by.season}}} +#' \item{\code{$dtr.ref}, an array with the same dimensions as the input +#' \code{data}, but with the time dimension reduce from daily to monthly +#' or seasonal resolution depending on the selected resolution in +#' \code{by.season}.} +#'\item{\code{$season}, a vector of the season or months corresponding to the +#' resolution selected in \code{by.season}.} +#'} #' -#'@details The function returns a reordered array with 'time' dimension in the first position in the \code{dtr.ref} label. +#'@details The function returns a reordered array with 'time' dimension in the +#' first position in the \code{dtr.ref} label. #' #'@import multiApply #'@examples @@ -30,7 +49,8 @@ #'time <- as.POSIXct(time, tz = "CET") #'metadata <- list(time = list(standard_name = 'time', long_name = 'time', #' calendar = 'noleap', -#' units = 'days since 1970-01-01 00:00:00', prec = 'double', +#' units = 'days since 1970-01-01 00:00:00', +#' prec = 'double', #' dim = list(list(name ='time', unlim = FALSE)))) #'attr(time, "variables") <- metadata #'attr(tmax, 'Variables')$dat1$time <- time @@ -48,7 +68,8 @@ #'tmin <- (1:(2 * 3 * 365 * 1))-1 #'dim(tmin) <- c(2, 3, 365) #' -#'a <- DTRRef(tmax, tmin, by.seasons = FALSE, dates = time, timedim = 3, ncores = NULL) +#'a <- DTRRef(tmax, tmin, by.seasons = FALSE, dates = time, timedim = 3, +#' ncores = NULL) #'str(a) #'@export DTRRef <- function(tmax, tmin, by.seasons = TRUE, dates = NULL, timedim = NULL, calendar = NULL, diff --git a/R/DailyAno.R b/R/DailyAno.R index d3df4cf..f0717d0 100644 --- a/R/DailyAno.R +++ b/R/DailyAno.R @@ -1,14 +1,20 @@ #'Daily anomalies #' -#'@description This function computes daily anomalies from a vector containing the daily time series. +#'@description This function computes daily anomalies from a vector containing +#'the daily time series. #' #'@param data A vector of daily data. -#'@param jdays A vector of the corresponding day of the year. This vector must be the same length as parameter \code{data}. -#'@param dates If \code{jdays} is not supplied, a vector of dates corresponding to the observations in \code{data} with defined calendar attributes. +#'@param jdays A vector of the corresponding day of the year. This vector must +#' be the same length as parameter \code{data}. +#'@param dates If \code{jdays} is not supplied, a vector of dates corresponding +#' to the observations in \code{data} with defined calendar attributes. #'@param calendar A character indicating the calendar type. -#'@param na.rm A logical indicating whether missing values should be removed. If \code{na.rm} is FALSE an NA value in any of the arguments will cause a value of NA to be returned, otherwise (TRUE by default) NA values are ignored. +#'@param na.rm A logical indicating whether missing values should be removed. If +#' \code{na.rm} is FALSE an NA value in any of the arguments will cause a value +#' of NA to be returned, otherwise (TRUE by default) NA values are ignored. #' -#'@return A vector of daily anomalies of the same length as parameter \code{data}. +#'@return A vector of daily anomalies of the same length as parameter +#'\code{data}. #' #'@examples #'# Time series in a vector example: diff --git a/R/Extremes.R b/R/Extremes.R index 149fd96..eab6793 100644 --- a/R/Extremes.R +++ b/R/Extremes.R @@ -22,10 +22,10 @@ #' #'@return A list of length 2: #'\itemize{ -#' \item\code{$output1}{An array with the same dimensions as the original -#' \code{data}, except the time dimension which is reduced to annual resolution -#' given a timeseries of maximum spell lengths for each year.} -#' \item\code{$year}{A vector indicating the corresponding years.} +#' \item{\code{$output1}, an array with the same dimensions as the original +#' \code{data}, except the time dimension which is reduced to annual +#' resolution given a timeseries of maximum spell lengths for each year.} +#' \item{\code{$year}, a vector indicating the corresponding years.} #'} #'@details This routine compares data to the thresholds using the given #'operator, generating a series of TRUE or FALSE values; these values are then @@ -45,11 +45,13 @@ #'time <- as.POSIXct(paste(sort(rep(1902:1911, 31)), 1, 1:31, sep = "-"), tz = "CET") #'metadata <- list(time = list(standard_name = 'time', long_name = 'time', #' calendar = 'noleap', -#' units = 'days since 1970-01-01 00:00:00', prec = 'double', +#' units = 'days since 1970-01-01 00:00:00', +#' prec = 'double', #' dim = list(list(name = 'time', unlim = FALSE)))) #'attr(time, "variables") <- metadata #'attr(data, 'Variables')$dat1$time <- time -#'threshold <- Threshold(data, dates = NULL, base.range = NULL, qtiles = 0.9, ncores = NULL) +#'threshold <- Threshold(data, dates = NULL, base.range = NULL, qtiles = 0.9, +#' ncores = NULL) #'res <- Extremes(data, threshold = threshold, op = ">", min.length = 6, #' spells.can.span.years = TRUE, max.missing.days = 5, #' ncores = NULL) diff --git a/R/Lon2Index.R b/R/Lon2Index.R index 1ab7197..e775595 100644 --- a/R/Lon2Index.R +++ b/R/Lon2Index.R @@ -1,12 +1,16 @@ #'Obtain the index of positions for a region in longitudes #' -#'@description This auxiliary function returns the index of position of a region of longitudes in a given vector of longitudes. +#'@description This auxiliary function returns the index of position of a region +#'of longitudes in a given vector of longitudes. #' #'@param lon vector of longitudes values. -#'@param lonmin a numeric value indicating the minimum longitude of the region (understand as the left marging of the region). -#'@param lonmax a numeric value indicating the maximum longitude of the region (understand as the right mariging of the region). +#'@param lonmin a numeric value indicating the minimum longitude of the region +#' (understand as the left marging of the region). +#'@param lonmax a numeric value indicating the maximum longitude of the region +#' (understand as the right mariging of the region). #' -#'@return the index of positions of all values inside the region in the vector lon. +#'@return the index of positions of all values inside the region in the vector +#'lon. #' #'@examples #' diff --git a/R/SeasonSelect.R b/R/SeasonSelect.R index 168696b..6ee8fbb 100644 --- a/R/SeasonSelect.R +++ b/R/SeasonSelect.R @@ -1,17 +1,29 @@ #'Selects a season from daily data for multidimensional arrays #' -#'@description This function selects the daily data corresponding to the specified season. +#'@description This function selects the daily data corresponding to the +#'specified season. #' #'@param data A numeric multidimensional array containing daily data. -#'@param season A charcater string indicating the season by the three months initials in capitals: 'DJF' for winter (summer), 'MAM' spring (autumn), 'JJA' for summer (winter) or 'SON' for autumn (spring) in the northern (southern) hemisphere. -#'@param dates A vector of dates with a calendar attributes. If NULL (by default), the 'time' attributes of parameter 'data' are considered. -#'@param timedim An integer number indicating the position of the time dimension in the parameter \code{data}. If NULL (by default), the dimension called 'time' in parameter \code{data}. +#'@param season A charcater string indicating the season by the three months +#' initials in capitals: 'DJF' for winter (summer), 'MAM' spring (autumn), +#' 'JJA' for summer (winter) or 'SON' for autumn (spring) in the northern +#' (southern) hemisphere. +#'@param dates A vector of dates with a calendar attributes. If NULL (by +#' default), the 'time' attributes of parameter 'data' are considered. +#'@param timedim An integer number indicating the position of the time dimension +#' in the parameter \code{data}. If NULL (by default), the dimension called +#' 'time' in parameter \code{data}. #'@param calendar A character indicating the calendar type. #' #'@return A list of length 2: #'\itemize{ -#'\item\code{$data} {A vector or array containing the daily values for the selected season, with the same dimensions as \code{data} input but the 'time' dimension reduce to the number of days corresponding to the selected season.} -#'\item\code{$dates} {A vector of dates reduce to the number of days corresponding to the selected season.}} +#' \item{\code{$data}, a vector or array containing the daily values for the +#' selected season, with the same dimensions as \code{data} input but the +#' 'time' dimension reduce to the number of days corresponding to the +#' selected season.} +#' \item{\code{$dates}, a vector of dates reduce to the number of days +#' corresponding to the selected season.} +#'} #' #'@import PCICt #'@examples @@ -22,7 +34,8 @@ #'time <- as.POSIXct(time, tz = "CET") #'metadata <- list(time = list(standard_name = 'time', long_name = 'time', #' calendar = 'noleap', -#' units = 'days since 1970-01-01 00:00:00', prec = 'double', +#' units = 'days since 1970-01-01 00:00:00', +#' prec = 'double', #' dim = list(list(name ='time', unlim = FALSE)))) #'attr(time, "variables") <- metadata #'attr(data, 'Variables')$dat1$time <- time diff --git a/R/SelBox.R b/R/SelBox.R index d743aef..15ae667 100644 --- a/R/SelBox.R +++ b/R/SelBox.R @@ -1,7 +1,7 @@ #'Select spatial region from multidimensional arrays #' -#'@description Subset a spatial region from spatial data giving a vector with -#' the maximum and minimum of latitudes and longitudes of the selected region. +#'@description Subset a spatial region from spatial data giving a vector with +#'the maximum and minimum of latitudes and longitudes of the selected region. #' #'@param data An array with minimum two dimensions of latitude and longitude. #'@param lon Numeric vector of longitude locations of the cell centers of the @@ -18,16 +18,17 @@ #' #'@return A list of length 4: #'\itemize{ -#' \item\code{$data}{ -#' An array with the same dimensions as the input \code{data} array, but with -#' spatial dimension reduced to the selected \code{region}} -#' \item\code{$lat}{A vector with the new corresponding latitudes for the -#' selected \code{region}} -#' \item\code{$lon}{A vector with the new corresponding longitudes for the -#' selected \code{region}} -#' \item\code{$mask}{If parameter \code{mask} is supplied, an array with -#' reduced length of the dimensions to the selected \code{region}. Otherwise, -#' a NULL element is returned.}} +#' \item{\code{$data}, an array with the same dimensions as the input +#' \code{data} array, but with spatial dimension reduced to the selected +#' \code{region}.} +#' \item{\code{$lat}, a vector with the new corresponding latitudes for the +#' selected \code{region}.} +#' \item{\code{$lon}, a vector with the new corresponding longitudes for the +#' selected \code{region}.} +#' \item{\code{$mask}, if parameter \code{mask} is supplied, an array with +#' reduced length of the dimensions to the selected \code{region}. +#' Otherwise, a NULL element is returned.} +#'} #' #'@examples #'# Example with synthetic data: diff --git a/R/Threshold.R b/R/Threshold.R index c6f4298..7444e1f 100644 --- a/R/Threshold.R +++ b/R/Threshold.R @@ -1,16 +1,21 @@ #'Daily thresholds based on quantiles for n-dimensional arrays #' -#'This function computes the threshold based on a quantile value for each day of the year of the daily data input. +#'This function computes the threshold based on a quantile value for each day of +#'the year of the daily data input. #' #'@param data A numeric n-dimensional array containing daily data. -#'@param dates A vector of dates with a calendar attributes. If NULL (by default), the 'time' attributes of parameter 'data' is considered. +#'@param dates A vector of dates with a calendar attributes. If NULL (by +#' default), the 'time' attributes of parameter 'data' is considered. #'@param calendar A character indicating the calendar type. #'@param base.range The years used for computing the threshold. -#'@param qtiles Numeric vector with values between 0 and 1 indicating the quantiles to be computed. +#'@param qtiles Numeric vector with values between 0 and 1 indicating the +#' quantiles to be computed. #'@param ncores The number of cores to be used when computing the threshold. -#'@param na.rm A logical value. If TRUE, any NA and NaN's are removed before the quantiles are computed (default as FALSE). +#'@param na.rm A logical value. If TRUE, any NA and NaN's are removed before the +#' quantiles are computed (default as FALSE). #' -#'@return An array with similar dimensions as the \code{data} input, but without 'time' dimension, and a new 'jdays' dimension. +#'@return An array with similar dimensions as the \code{data} input, but without +#''time' dimension, and a new 'jdays' dimension. #' #'@import multiApply #'@import PCICt @@ -19,14 +24,17 @@ #'##Example synthetic data: #'data <- 1:(2 * 3 * 372 * 1) #'dim(data) <- c(time = 372, lon = 2, lat = 3, model = 1) -#'time <- as.POSIXct(paste(sort(rep(1900:1911, 31)), 1, 1:31, sep = "-"), tz = "CET") -#'metadata <- list(time = list(standard_name = 'time', long_name = 'time', calendar = 'noleap', -#' units = 'days since 1970-01-01 00:00:00', prec = 'double', -#' dim = list(list(name = 'time', unlim = FALSE)))) +#'time <- as.POSIXct(paste(sort(rep(1900:1911, 31)), 1, 1:31, sep = "-"), +#' tz = "CET") +#'metadata <- list(time = list(standard_name = 'time', long_name = 'time', +#' calendar = 'noleap', +#' units = 'days since 1970-01-01 00:00:00', prec = 'double', +#' dim = list(list(name = 'time', unlim = FALSE)))) #'attr(time, "variables") <- metadata #'attr(data, 'Variables')$dat1$time <- time #' -#'a <- Threshold(data, dates = NULL, base.range = NULL, qtiles = 0.9, ncores = NULL) +#'a <- Threshold(data, dates = NULL, base.range = NULL, qtiles = 0.9, +#' ncores = NULL) #'str(a) #' #'@export diff --git a/R/WaveDuration.R b/R/WaveDuration.R index 76874f9..5206c32 100644 --- a/R/WaveDuration.R +++ b/R/WaveDuration.R @@ -23,13 +23,15 @@ #'@param ncores The number of cores to be used when computing the wave duration. #' #'@return A list of length 2: -#' \itemize{ -#' \item\code{$result}{An array with the same dimensions as the input -#' \code{data}, but with the time dimension reduce from daily to monthly or -#' seasonal resolution depending on the selected resolution in \code{by.season}.} -#' \item\code{$years}{A vector of the years and season/months corresponding to -#' the resolution selected in \code{by.season} and temporal length of the input -#' \code{data}}} +#'\itemize{ +#' \item{\code{$result}, an array with the same dimensions as the input +#' \code{data}, but with the time dimension reduce from daily to monthly +#' or seasonal resolution depending on the selected resolution in +#' \code{by.season}.} +#' \item{\code{$years}, a vector of the years and season/months corresponding +#' to the resolution selected in \code{by.season} and temporal length of +#' the input \code{data}.} +#'} #' #'@import multiApply #'@import PCICt diff --git a/man/AnoAgree.Rd b/man/AnoAgree.Rd index 63c1450..bb4b30f 100644 --- a/man/AnoAgree.Rd +++ b/man/AnoAgree.Rd @@ -2,7 +2,8 @@ % Please edit documentation in R/AnoAgree.R \name{AnoAgree} \alias{AnoAgree} -\title{Percentage of anomalies which agrees with the sign of the mean anomaly for multidimensional arrays} +\title{Percentage of anomalies which agrees with the sign of the mean anomaly for +multidimensional arrays} \usage{ AnoAgree(ano, membersdim, na.rm = TRUE, ncores = NULL) } @@ -11,15 +12,20 @@ AnoAgree(ano, membersdim, na.rm = TRUE, ncores = NULL) \item{membersdim}{The dimension in which models are stored.} -\item{na.rm}{A logical indicating whether missing values should be removed. If \code{na.rm} is FALSE an NA value in any of the arguments will cause a value of NA to be returned, otherwise (TRUE by default) NA values are ignored.} +\item{na.rm}{A logical indicating whether missing values should be removed. If +\code{na.rm} is FALSE an NA value in any of the arguments will cause a value +of NA to be returned, otherwise (TRUE by default) NA values are ignored.} \item{ncores}{The number of cores to be used when computing the agreement.} } \value{ -An array of one dimension less than the \code{ano} object, except for one dimensional arrays or vectors, for which an array of dimension 1 called 'var' is returned. +An array of one dimension less than the \code{ano} object, except for +one dimensional arrays or vectors, for which an array of dimension 1 called +'var' is returned. } \description{ -This function computes the mean and the percentage of agreement between anomalies. +This function computes the mean and the percentage of agreement +between anomalies. } \examples{ # Example with random sample: @@ -27,7 +33,8 @@ a <- NULL for(i in 1:20) { a <- c(a, rnorm(6)) } dim(a) <- c(lat = 2, lon = 3, var = 4, mod = 5) -agree <- AnoAgree(ano = a, membersdim = which(names(dim(a)) == 'mod'), na.rm = TRUE, ncores = NULL) +agree <- AnoAgree(ano = a, membersdim = which(names(dim(a)) == 'mod'), + na.rm = TRUE, ncores = NULL) print(agree) a <- rnorm(6) diff --git a/man/ArrayToList.Rd b/man/ArrayToList.Rd index 9951ae1..43d3278 100644 --- a/man/ArrayToList.Rd +++ b/man/ArrayToList.Rd @@ -9,17 +9,24 @@ ArrayToList(data, dim, level = "list", names = NULL) \arguments{ \item{data}{A multidimensional array.} -\item{dim}{A character string indicating the name of the dimension to split or an integer indicating the position of the dimension.} +\item{dim}{A character string indicating the name of the dimension to split or +an integer indicating the position of the dimension.} -\item{level}{A string character 'list' or 'sublist' indicating if it should be a list or a sublist. By default it creates a list.} +\item{level}{A string character 'list' or 'sublist' indicating if it should be +a list or a sublist. By default it creates a list.} -\item{names}{A vector of character strings to name the list (if it is a single string, it would be reused) or a single character string to name the elements in the sublist.} +\item{names}{A vector of character strings to name the list (if it is a single +string, it would be reused) or a single character string to name the +elements in the sublist.} } \value{ A list of arrays of the length of the dimension set in parameter 'dim'. } \description{ -This function splits an array into a list as required by PlotLayout function from package "s2dv" when parameter 'special_args' is used. The function ArrayToList allows to add names to the elements of the list in two different levels, the 'list' or the 'sublist'. +This function splits an array into a list as required by +PlotLayout function from package "s2dv" when parameter 'special_args' is used. +The function ArrayToList allows to add names to the elements of the list in +two different levels, the 'list' or the 'sublist'. } \examples{ data <- array(1:240, c(month = 12, member = 5, time = 4)) diff --git a/man/Climdex.Rd b/man/Climdex.Rd index 7afbf0b..e7580e1 100644 --- a/man/Climdex.Rd +++ b/man/Climdex.Rd @@ -44,10 +44,10 @@ in the parameter \code{data}. If NULL (by default), the dimension called \value{ A list of length 2: \itemize{ - \item\code{$result} {An array with the same dimensions as the input array, - except for the temporal dimension which is renamed to 'year', moved to the - first dimension position and reduce to annual resolution.} - \item\code{$years} {A vector of the corresponding years.} + \item{\code{$result}, an array with the same dimensions as the input array, + except for the temporal dimension which is renamed to 'year', moved + to the first dimension position and reduce to annual resolution.} + \item{\code{$years}, a vector of the corresponding years.} } } \description{ diff --git a/man/CombineIndices.Rd b/man/CombineIndices.Rd index 6d032cd..f0e5ff6 100644 --- a/man/CombineIndices.Rd +++ b/man/CombineIndices.Rd @@ -7,29 +7,39 @@ CombineIndices(indices, weights = NULL, operation = "mean") } \arguments{ -\item{indices}{List of n-dimensional arrays with equal dimensions to be combined.} +\item{indices}{List of n-dimensional arrays with equal dimensions to be +combined.} -\item{weights}{Vector of weights for the indices, whose length is the same as the list of parameter \code{indices}. If not provided, a weight of 1 is assigned to each index. If \code{operation = 'mean'} the weights are normalized to sum 1 all together.} +\item{weights}{Vector of weights for the indices, whose length is the same as +the list of parameter \code{indices}. If not provided, a weight of 1 is +assigned to each index. If \code{operation = 'mean'} the weights are +normalized to sum 1 all together.} -\item{operation}{The operation for combining the indices, either \code{"mean"} (default), \code{"add"}, \code{"subtract"} or \code{"divide"}.} +\item{operation}{The operation for combining the indices, either \code{"mean"} +(default), \code{"add"}, \code{"subtract"} or \code{"divide"}.} } \value{ -An array of the same dimensions as one of the elements in the parameter \code{indices}. +An array of the same dimensions as one of the elements in the +parameter \code{indices}. } \description{ -Function to combine climate indices for multiple models through addition, subtraction, division or averaging, optionally applying weights to each index. +Function to combine climate indices for multiple models through +addition, subtraction, division or averaging, optionally applying weights to +each index. } \examples{ a <- matrix(rnorm(6), 2, 3) b <- matrix(rnorm(6), 2, 3) -comb_ind <- CombineIndices(indices = list(a, b), weights = c(2, 1), operation = "add") +comb_ind <- CombineIndices(indices = list(a, b), weights = c(2, 1), + operation = "add") print(comb_ind) a <- rnorm(24) dim(a) <- c(lon = 2, lat = 3, mod = 4) b <- rnorm(24) dim(b) <- c(lon = 2, lat = 3, mod = 4) -comb_ind <- CombineIndices(indices = list(a, b), weights = c(2, 1), operation = "add") +comb_ind <- CombineIndices(indices = list(a, b), weights = c(2, 1), + operation = "add") print(comb_ind) } diff --git a/man/DTRIndicator.Rd b/man/DTRIndicator.Rd index e8be18b..d310b7b 100644 --- a/man/DTRIndicator.Rd +++ b/man/DTRIndicator.Rd @@ -16,17 +16,31 @@ DTRIndicator( ) } \arguments{ -\item{tmax}{A numeric multidimensional array containing daily maximum temperature.} +\item{tmax}{A numeric multidimensional array containing daily maximum +temperature.} -\item{tmin}{A numeric multidimensional array containing daily minimum temperature. This array must be the same dimensions as \code{tmax} parameter.} +\item{tmin}{A numeric multidimensional array containing daily minimum +temperature. This array must be the same dimensions as \code{tmax} +parameter.} -\item{ref}{An output list from the \code{DTRRef} function with the same dimensions as parameters \code{tmax} and \code{tmin}, except the time dimension, containing the mean diurnal temperature variation for the reference period.} +\item{ref}{An output list from the \code{DTRRef} function with the same +dimensions as parameters \code{tmax} and \code{tmin}, except the time +dimension, containing the mean diurnal temperature variation for the +reference period.} -\item{by.seasons}{If TRUE (by default), the DTR is computed for each season (December-January-February, March-April-May, June-July-August and September-October-November) seperately. If FALSE is specified, the montly mean DTR is computed.} +\item{by.seasons}{If TRUE (by default), the DTR is computed for each season +(December-January-February, March-April-May, June-July-August and +September-October-November) seperately. If FALSE is specified, the montly +mean DTR is computed.} -\item{dates}{A vector of dates with a calendar attributes. If NULL (by default), the 'time' attributes of parameter 'tmax' and 'tmin' are considered.} +\item{dates}{A vector of dates with a calendar attributes. If NULL (by +default), the 'time' attributes of parameter 'tmax' and 'tmin' are +considered.} -\item{timedim}{An integer number indicating the position of the time dimension in the parameters \code{tmax} and \code{tmin}. If NULL (by default), the dimension called 'time' in parameter \code{tmax} and \code{tmin} is considered as time dimension.} +\item{timedim}{An integer number indicating the position of the time dimension +in the parameters \code{tmax} and \code{tmin}. If NULL (by default), the +dimension called 'time' in parameter \code{tmax} and \code{tmin} is +considered as time dimension.} \item{calendar}{A character indicating the calendar type.} @@ -35,12 +49,20 @@ DTRIndicator( \value{ A list of length 3: \itemize{ -\item\code{$dtr.ref}{An array with the same dimensions as the input \code{data}, but with the time dimension reduce from daily to monthly or seasonal resolution depending on the selected resolution in \code{by.season}.} -\item\code{$year}{A vector of the corresponding years.} -\item\code{$season}{A vector of the seasons or months corresponding to the resolution selected in \code{by.season}}} + \item{\code{$dtr.ref}, an array with the same dimensions as the input + \code{data}, but with the time dimension reduce from daily to monthly + or seasonal resolution depending on the selected resolution in + \code{by.season}.} + \item{\code{$year}, a vector of the corresponding years.} + \item{\code{$season}, a vector of the seasons or months corresponding to the + resolution selected in \code{by.season}.} +} } \description{ -This function computes the diurnal temperature indicator, defined as the number of days where the diurnal temperature variation exceeds the vulnerability threshold (defined as the mean(tmax -tmin) + 5 from the reference period). +This function computes the diurnal temperature indicator, defined +as the number of days where the diurnal temperature variation exceeds the +vulnerability threshold (defined as the mean(tmax -tmin) + 5 from the +reference period). } \examples{ ##Exmaple with synthetic data: @@ -48,12 +70,15 @@ tmax <- 1 : (2 * 3 * 730 * 1) dim(tmax) <- c(lon = 2, lat = 3, time = 730, model = 1) tmin <- (1 : (2 * 3 * 730 * 1)) - 1 dim(tmin) <- c(lon = 2, lat = 3, time = 730, model = 1) -time <- seq(as.POSIXct("1900-01-01 12:00:00", tz = "", format = "\%Y-\%d-\%m \%H:\%M:\%S"), - as.POSIXct("1901-31-12 18:00:00", tz = "", format = "\%Y-\%d-\%m \%H:\%M:\%S"), "day") +time <- seq(as.POSIXct("1900-01-01 12:00:00", tz = "", + format = "\%Y-\%d-\%m \%H:\%M:\%S"), + as.POSIXct("1901-31-12 18:00:00", tz = "", + format = "\%Y-\%d-\%m \%H:\%M:\%S"), "day") time <- as.POSIXct(time, tz = "CET") metadata <- list(time = list(standard_name = 'time', long_name = 'time', calendar = 'noleap', - units = 'days since 1970-01-01 00:00:00', prec = 'double', + units = 'days since 1970-01-01 00:00:00', + prec = 'double', dim = list(list(name ='time', unlim = FALSE)))) attr(time, "variables") <- metadata attr(tmax, 'Variables')$dat1$time <- time diff --git a/man/DTRRef.Rd b/man/DTRRef.Rd index daea8c2..ab44bb0 100644 --- a/man/DTRRef.Rd +++ b/man/DTRRef.Rd @@ -16,33 +16,52 @@ DTRRef( ) } \arguments{ -\item{tmax}{A numeric multidimensional array containing daily maximum temperature.} +\item{tmax}{A numeric multidimensional array containing daily maximum +temperature.} -\item{tmin}{A numeric multidimensional array containing daily minimum temperature.} +\item{tmin}{A numeric multidimensional array containing daily minimum +temperature.} -\item{by.seasons}{If TRUE (by default), the DTR is computed for each season (December-January-February, March-April-May, June-July-August and September-October-November) seperately. If FALSE is specified, the montly mean DTR is computed.} +\item{by.seasons}{If TRUE (by default), the DTR is computed for each season +(December-January-February, March-April-May, June-July-August and +September-October-November) seperately. If FALSE is specified, the montly +mean DTR is computed.} -\item{dates}{A vector of dates with a calendar attributes. If NULL (by default), the 'time' attributes of parameter 'tmax' and 'tmin' are considered.} +\item{dates}{A vector of dates with a calendar attributes. If NULL (by +default), the 'time' attributes of parameter 'tmax' and 'tmin' are +considered.} -\item{timedim}{An integer number indicating the position of the time dimension in the parameters \code{tmax} and \code{tmin}. If NULL (by default), the dimension called 'time' in parameter \code{tmax} and \code{tmin} is considered as time dimension.} +\item{timedim}{An integer number indicating the position of the time dimension +in the parameters \code{tmax} and \code{tmin}. If NULL (by default), the +dimension called 'time' in parameter \code{tmax} and \code{tmin} is +considered as time dimension.} \item{calendar}{A character indicating the calendar type.} -\item{na.rm}{A logical indicating whether missing values should be removed. If \code{na.rm} is FALSE an NA value in any of the arguments will cause a value of NA to be returned, otherwise (TRUE by default) NA values are ignored.} +\item{na.rm}{A logical indicating whether missing values should be removed. If +\code{na.rm} is FALSE an NA value in any of the arguments will cause a value +of NA to be returned, otherwise (TRUE by default) NA values are ignored.} \item{ncores}{The number of cores to be used when computing the index.} } \value{ A list of length 2: \itemize{ -\item\code{$dtr.ref} {An array with the same dimensions as the input \code{data}, but with the time dimension reduce from daily to monthly or seasonal resolution depending on the selected resolution in \code{by.season}.} -\item\code{$season} {A vector of the season or months corresponding to the resolution selected in \code{by.season}}} + \item{\code{$dtr.ref}, an array with the same dimensions as the input + \code{data}, but with the time dimension reduce from daily to monthly + or seasonal resolution depending on the selected resolution in + \code{by.season}.} +\item{\code{$season}, a vector of the season or months corresponding to the + resolution selected in \code{by.season}.} +} } \description{ -This function computes the mean diurnal temperature range (tmax - tmin). +This function computes the mean diurnal temperature range +(tmax - tmin). } \details{ -The function returns a reordered array with 'time' dimension in the first position in the \code{dtr.ref} label. +The function returns a reordered array with 'time' dimension in the + first position in the \code{dtr.ref} label. } \examples{ ##Exmaple with synthetic data: @@ -55,7 +74,8 @@ time <- seq.Date(as.Date("1900-01-01", format = "\%Y-\%d-\%m"), time <- as.POSIXct(time, tz = "CET") metadata <- list(time = list(standard_name = 'time', long_name = 'time', calendar = 'noleap', - units = 'days since 1970-01-01 00:00:00', prec = 'double', + units = 'days since 1970-01-01 00:00:00', + prec = 'double', dim = list(list(name ='time', unlim = FALSE)))) attr(time, "variables") <- metadata attr(tmax, 'Variables')$dat1$time <- time @@ -73,6 +93,7 @@ dim(tmax) <- c(2, 3, 365) tmin <- (1:(2 * 3 * 365 * 1))-1 dim(tmin) <- c(2, 3, 365) -a <- DTRRef(tmax, tmin, by.seasons = FALSE, dates = time, timedim = 3, ncores = NULL) +a <- DTRRef(tmax, tmin, by.seasons = FALSE, dates = time, timedim = 3, + ncores = NULL) str(a) } diff --git a/man/DailyAno.Rd b/man/DailyAno.Rd index 3bf59f6..d2729fe 100644 --- a/man/DailyAno.Rd +++ b/man/DailyAno.Rd @@ -9,19 +9,25 @@ DailyAno(data, jdays = NULL, dates = NULL, calendar = NULL, na.rm = TRUE) \arguments{ \item{data}{A vector of daily data.} -\item{jdays}{A vector of the corresponding day of the year. This vector must be the same length as parameter \code{data}.} +\item{jdays}{A vector of the corresponding day of the year. This vector must +be the same length as parameter \code{data}.} -\item{dates}{If \code{jdays} is not supplied, a vector of dates corresponding to the observations in \code{data} with defined calendar attributes.} +\item{dates}{If \code{jdays} is not supplied, a vector of dates corresponding +to the observations in \code{data} with defined calendar attributes.} \item{calendar}{A character indicating the calendar type.} -\item{na.rm}{A logical indicating whether missing values should be removed. If \code{na.rm} is FALSE an NA value in any of the arguments will cause a value of NA to be returned, otherwise (TRUE by default) NA values are ignored.} +\item{na.rm}{A logical indicating whether missing values should be removed. If +\code{na.rm} is FALSE an NA value in any of the arguments will cause a value +of NA to be returned, otherwise (TRUE by default) NA values are ignored.} } \value{ -A vector of daily anomalies of the same length as parameter \code{data}. +A vector of daily anomalies of the same length as parameter +\code{data}. } \description{ -This function computes daily anomalies from a vector containing the daily time series. +This function computes daily anomalies from a vector containing +the daily time series. } \examples{ # Time series in a vector example: diff --git a/man/Extremes.Rd b/man/Extremes.Rd index 34a4e71..e2d96ae 100644 --- a/man/Extremes.Rd +++ b/man/Extremes.Rd @@ -46,10 +46,10 @@ in the parameter \code{data}. If NULL (by default), the dimension called \value{ A list of length 2: \itemize{ - \item\code{$output1}{An array with the same dimensions as the original - \code{data}, except the time dimension which is reduced to annual resolution - given a timeseries of maximum spell lengths for each year.} - \item\code{$year}{A vector indicating the corresponding years.} + \item{\code{$output1}, an array with the same dimensions as the original + \code{data}, except the time dimension which is reduced to annual + resolution given a timeseries of maximum spell lengths for each year.} + \item{\code{$year}, a vector indicating the corresponding years.} } } \description{ @@ -74,11 +74,13 @@ dim(data) <- c(time = 310, lon = 2, lat = 3, model = 1) time <- as.POSIXct(paste(sort(rep(1902:1911, 31)), 1, 1:31, sep = "-"), tz = "CET") metadata <- list(time = list(standard_name = 'time', long_name = 'time', calendar = 'noleap', - units = 'days since 1970-01-01 00:00:00', prec = 'double', + units = 'days since 1970-01-01 00:00:00', + prec = 'double', dim = list(list(name = 'time', unlim = FALSE)))) attr(time, "variables") <- metadata attr(data, 'Variables')$dat1$time <- time -threshold <- Threshold(data, dates = NULL, base.range = NULL, qtiles = 0.9, ncores = NULL) +threshold <- Threshold(data, dates = NULL, base.range = NULL, qtiles = 0.9, + ncores = NULL) res <- Extremes(data, threshold = threshold, op = ">", min.length = 6, spells.can.span.years = TRUE, max.missing.days = 5, ncores = NULL) diff --git a/man/Lon2Index.Rd b/man/Lon2Index.Rd index dbae6dc..0057319 100644 --- a/man/Lon2Index.Rd +++ b/man/Lon2Index.Rd @@ -9,15 +9,19 @@ Lon2Index(lon, lonmin, lonmax) \arguments{ \item{lon}{vector of longitudes values.} -\item{lonmin}{a numeric value indicating the minimum longitude of the region (understand as the left marging of the region).} +\item{lonmin}{a numeric value indicating the minimum longitude of the region +(understand as the left marging of the region).} -\item{lonmax}{a numeric value indicating the maximum longitude of the region (understand as the right mariging of the region).} +\item{lonmax}{a numeric value indicating the maximum longitude of the region +(understand as the right mariging of the region).} } \value{ -the index of positions of all values inside the region in the vector lon. +the index of positions of all values inside the region in the vector +lon. } \description{ -This auxiliary function returns the index of position of a region of longitudes in a given vector of longitudes. +This auxiliary function returns the index of position of a region +of longitudes in a given vector of longitudes. } \examples{ diff --git a/man/SeasonSelect.Rd b/man/SeasonSelect.Rd index 33066ee..70b411b 100644 --- a/man/SeasonSelect.Rd +++ b/man/SeasonSelect.Rd @@ -9,22 +9,34 @@ SeasonSelect(data, season, dates = NULL, timedim = NULL, calendar = NULL) \arguments{ \item{data}{A numeric multidimensional array containing daily data.} -\item{season}{A charcater string indicating the season by the three months initials in capitals: 'DJF' for winter (summer), 'MAM' spring (autumn), 'JJA' for summer (winter) or 'SON' for autumn (spring) in the northern (southern) hemisphere.} +\item{season}{A charcater string indicating the season by the three months +initials in capitals: 'DJF' for winter (summer), 'MAM' spring (autumn), +'JJA' for summer (winter) or 'SON' for autumn (spring) in the northern +(southern) hemisphere.} -\item{dates}{A vector of dates with a calendar attributes. If NULL (by default), the 'time' attributes of parameter 'data' are considered.} +\item{dates}{A vector of dates with a calendar attributes. If NULL (by +default), the 'time' attributes of parameter 'data' are considered.} -\item{timedim}{An integer number indicating the position of the time dimension in the parameter \code{data}. If NULL (by default), the dimension called 'time' in parameter \code{data}.} +\item{timedim}{An integer number indicating the position of the time dimension +in the parameter \code{data}. If NULL (by default), the dimension called +'time' in parameter \code{data}.} \item{calendar}{A character indicating the calendar type.} } \value{ A list of length 2: \itemize{ -\item\code{$data} {A vector or array containing the daily values for the selected season, with the same dimensions as \code{data} input but the 'time' dimension reduce to the number of days corresponding to the selected season.} -\item\code{$dates} {A vector of dates reduce to the number of days corresponding to the selected season.}} + \item{\code{$data}, a vector or array containing the daily values for the + selected season, with the same dimensions as \code{data} input but the + 'time' dimension reduce to the number of days corresponding to the + selected season.} + \item{\code{$dates}, a vector of dates reduce to the number of days + corresponding to the selected season.} +} } \description{ -This function selects the daily data corresponding to the specified season. +This function selects the daily data corresponding to the +specified season. } \examples{ ## Example with synthetic data: @@ -34,7 +46,8 @@ time <- seq(ISOdate(1903,1,1), ISOdate(1904,12,31), "days") time <- as.POSIXct(time, tz = "CET") metadata <- list(time = list(standard_name = 'time', long_name = 'time', calendar = 'noleap', - units = 'days since 1970-01-01 00:00:00', prec = 'double', + units = 'days since 1970-01-01 00:00:00', + prec = 'double', dim = list(list(name ='time', unlim = FALSE)))) attr(time, "variables") <- metadata attr(data, 'Variables')$dat1$time <- time diff --git a/man/SelBox.Rd b/man/SelBox.Rd index 1bc496b..13819e5 100644 --- a/man/SelBox.Rd +++ b/man/SelBox.Rd @@ -29,20 +29,21 @@ dimension. The default value is 'lat'.} \value{ A list of length 4: \itemize{ - \item\code{$data}{ - An array with the same dimensions as the input \code{data} array, but with - spatial dimension reduced to the selected \code{region}} - \item\code{$lat}{A vector with the new corresponding latitudes for the - selected \code{region}} - \item\code{$lon}{A vector with the new corresponding longitudes for the - selected \code{region}} - \item\code{$mask}{If parameter \code{mask} is supplied, an array with - reduced length of the dimensions to the selected \code{region}. Otherwise, - a NULL element is returned.}} + \item{\code{$data}, an array with the same dimensions as the input + \code{data} array, but with spatial dimension reduced to the selected + \code{region}.} + \item{\code{$lat}, a vector with the new corresponding latitudes for the + selected \code{region}.} + \item{\code{$lon}, a vector with the new corresponding longitudes for the + selected \code{region}.} + \item{\code{$mask}, if parameter \code{mask} is supplied, an array with + reduced length of the dimensions to the selected \code{region}. + Otherwise, a NULL element is returned.} +} } \description{ -Subset a spatial region from spatial data giving a vector with - the maximum and minimum of latitudes and longitudes of the selected region. +Subset a spatial region from spatial data giving a vector with +the maximum and minimum of latitudes and longitudes of the selected region. } \examples{ # Example with synthetic data: diff --git a/man/Threshold.Rd b/man/Threshold.Rd index e6ae99f..0e661eb 100644 --- a/man/Threshold.Rd +++ b/man/Threshold.Rd @@ -17,36 +17,44 @@ Threshold( \arguments{ \item{data}{A numeric n-dimensional array containing daily data.} -\item{dates}{A vector of dates with a calendar attributes. If NULL (by default), the 'time' attributes of parameter 'data' is considered.} +\item{dates}{A vector of dates with a calendar attributes. If NULL (by +default), the 'time' attributes of parameter 'data' is considered.} \item{calendar}{A character indicating the calendar type.} \item{base.range}{The years used for computing the threshold.} -\item{qtiles}{Numeric vector with values between 0 and 1 indicating the quantiles to be computed.} +\item{qtiles}{Numeric vector with values between 0 and 1 indicating the +quantiles to be computed.} \item{ncores}{The number of cores to be used when computing the threshold.} -\item{na.rm}{A logical value. If TRUE, any NA and NaN's are removed before the quantiles are computed (default as FALSE).} +\item{na.rm}{A logical value. If TRUE, any NA and NaN's are removed before the +quantiles are computed (default as FALSE).} } \value{ -An array with similar dimensions as the \code{data} input, but without 'time' dimension, and a new 'jdays' dimension. +An array with similar dimensions as the \code{data} input, but without +'time' dimension, and a new 'jdays' dimension. } \description{ -This function computes the threshold based on a quantile value for each day of the year of the daily data input. +This function computes the threshold based on a quantile value for each day of +the year of the daily data input. } \examples{ ##Example synthetic data: data <- 1:(2 * 3 * 372 * 1) dim(data) <- c(time = 372, lon = 2, lat = 3, model = 1) -time <- as.POSIXct(paste(sort(rep(1900:1911, 31)), 1, 1:31, sep = "-"), tz = "CET") -metadata <- list(time = list(standard_name = 'time', long_name = 'time', calendar = 'noleap', - units = 'days since 1970-01-01 00:00:00', prec = 'double', - dim = list(list(name = 'time', unlim = FALSE)))) +time <- as.POSIXct(paste(sort(rep(1900:1911, 31)), 1, 1:31, sep = "-"), + tz = "CET") +metadata <- list(time = list(standard_name = 'time', long_name = 'time', + calendar = 'noleap', + units = 'days since 1970-01-01 00:00:00', prec = 'double', + dim = list(list(name = 'time', unlim = FALSE)))) attr(time, "variables") <- metadata attr(data, 'Variables')$dat1$time <- time -a <- Threshold(data, dates = NULL, base.range = NULL, qtiles = 0.9, ncores = NULL) +a <- Threshold(data, dates = NULL, base.range = NULL, qtiles = 0.9, + ncores = NULL) str(a) } diff --git a/man/WaveDuration.Rd b/man/WaveDuration.Rd index e639d55..bca70b0 100644 --- a/man/WaveDuration.Rd +++ b/man/WaveDuration.Rd @@ -43,13 +43,15 @@ default), the 'time' attributes of parameter 'data' is used.} } \value{ A list of length 2: - \itemize{ - \item\code{$result}{An array with the same dimensions as the input - \code{data}, but with the time dimension reduce from daily to monthly or - seasonal resolution depending on the selected resolution in \code{by.season}.} - \item\code{$years}{A vector of the years and season/months corresponding to - the resolution selected in \code{by.season} and temporal length of the input - \code{data}}} +\itemize{ + \item{\code{$result}, an array with the same dimensions as the input + \code{data}, but with the time dimension reduce from daily to monthly + or seasonal resolution depending on the selected resolution in + \code{by.season}.} + \item{\code{$years}, a vector of the years and season/months corresponding + to the resolution selected in \code{by.season} and temporal length of + the input \code{data}.} +} } \description{ This function computes the duration of a heat/cold wave as the number of -- GitLab From b61780380d1f919804ccf825b8fad39313b83fdf Mon Sep 17 00:00:00 2001 From: EVA RIFA ROVIRA Date: Thu, 25 Jan 2024 10:08:43 +0100 Subject: [PATCH 8/9] Update imports in DESCRIPTION --- DESCRIPTION | 1 - 1 file changed, 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5818d85..d0cf868 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,6 @@ Depends: Imports: multiApply (>= 2.0.0), PCICt, - plyr, stats Suggests: knitr, -- GitLab From 1e32077f331262e44272d1c52b47f7faad15bdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eva=20Rif=C3=A0?= Date: Thu, 25 Jan 2024 15:58:02 +0100 Subject: [PATCH 9/9] Update NEWS.md with today's date --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 6e7949c..3df80bb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# 0.3.3 (Release date: 2024-01-24) +# 0.3.3 (Release date: 2024-01-25) - Bugfix in Subset() for drop = T, didn't have correct given output dimension therefore returned error. It happened when the output dimension is 1 and the length is > 1. # 0.3.2 (Release date: 2023-06-01) -- GitLab