diff --git a/R/PeriodStandardization.R b/R/PeriodStandardization.R index 6ab707e713174dc8ebb41ce8fce3e240946bd05f..b71270f14086d2db804f4a046b0766b6f1952edc 100644 --- a/R/PeriodStandardization.R +++ b/R/PeriodStandardization.R @@ -12,12 +12,12 @@ #'coordinates and therefore, the result will be filled with NA for the #'specific coordinates. When NAs are not removed, if the length of the data for #'a computational step is smaller than 4, there will not be enough data for -#'standarize and the result will be also filled with NAs for that coordinates. +#'standardization and the result will be also filled with NAs for those coordinates. #'About the distribution used to fit the data, there are only two possibilities: -#''log-logistic' and 'Gamma'. The 'Gamma' method only works when only -#'precipitation is provided and other variables are 0 because it is positive +#''log-logistic' and 'Gamma'. The 'Gamma' method works only when precipitation +#'is the sole variable provided, and all other variables are 0 because it is positive #'defined (SPI indicator). When only 'data' is provided ('data_cor' is NULL) the -#'standardization is computed with cross validation. This function is build to +#'standardization is computed with cross validation. This function is built to #'be compatible with other tools in that work with 's2dv_cube' object #'class. The input data must be this object class. If you don't work with #''s2dv_cube', see PeriodStandardization. For more information on the SPEI @@ -108,6 +108,7 @@ CST_PeriodStandardization <- function(data, data_cor = NULL, time_dim = 'syear', } } res <- PeriodStandardization(data = data$data, data_cor = data_cor$data, + dates = data$attrs$Dates, time_dim = time_dim, leadtime_dim = leadtime_dim, memb_dim = memb_dim, ref_period = ref_period, @@ -337,7 +338,7 @@ PeriodStandardization <- function(data, data_cor = NULL, dates = NULL, "will not be used.") ref_period <- NULL } else if (!all(unlist(ref_period) %in% years_dates)) { - warning("Parameter 'ref_period' contain years outside the dates. ", + warning("Parameter 'ref_period' contains years outside the dates. ", "It will not be used.") ref_period <- NULL } else { diff --git a/man/CST_PeriodStandardization.Rd b/man/CST_PeriodStandardization.Rd index fe0dd3b9f59e082ae322e884b94415ea4246c8af..95f6474d01337915052b2f731fd967f82b745dc4 100644 --- a/man/CST_PeriodStandardization.Rd +++ b/man/CST_PeriodStandardization.Rd @@ -105,12 +105,12 @@ parameter 'na.rm', the standardization cannot be carried out for those coordinates and therefore, the result will be filled with NA for the specific coordinates. When NAs are not removed, if the length of the data for a computational step is smaller than 4, there will not be enough data for -standarize and the result will be also filled with NAs for that coordinates. +standardization and the result will be also filled with NAs for those coordinates. About the distribution used to fit the data, there are only two possibilities: -'log-logistic' and 'Gamma'. The 'Gamma' method only works when only -precipitation is provided and other variables are 0 because it is positive +'log-logistic' and 'Gamma'. The 'Gamma' method works only when precipitation +is the sole variable provided, and all other variables are 0 because it is positive defined (SPI indicator). When only 'data' is provided ('data_cor' is NULL) the -standardization is computed with cross validation. This function is build to +standardization is computed with cross validation. This function is built to be compatible with other tools in that work with 's2dv_cube' object class. The input data must be this object class. If you don't work with 's2dv_cube', see PeriodStandardization. For more information on the SPEI diff --git a/tests/testthat/test-PeriodStandardization.R b/tests/testthat/test-PeriodStandardization.R index 7673db2d070cef7f71506bf80acbef78694ae42e..1e816c005efe765d119cfc0645b787d5780b8390 100644 --- a/tests/testthat/test-PeriodStandardization.R +++ b/tests/testthat/test-PeriodStandardization.R @@ -130,7 +130,7 @@ test_that("1. Initial checks PeriodStandardization", { expect_warning( PeriodStandardization(data = dat1, ref_period = list(2020, 2021), dates = dates1), - paste0("Parameter 'ref_period' contain years outside the dates. ", + paste0("Parameter 'ref_period' contains years outside the dates. ", "It will not be used.") ) # handle_infinity