diff --git a/R/CST_Anomaly.R b/R/CST_Anomaly.R index 489835c67e4fd4cceaa0d02a185a37c8635ac5d4..c93267413c41aa336280715f389d0c540ec1e82b 100644 --- a/R/CST_Anomaly.R +++ b/R/CST_Anomaly.R @@ -1,4 +1,5 @@ -#'Anomalies relative to a climatology along selected dimension with or without cross-validation +#'Anomalies relative to a climatology along selected dimension with or without +#'cross-validation #' #'@author Perez-Zanon Nuria, \email{nuria.perez@bsc.es} #'@author Pena Jesus, \email{jesus.pena@bsc.es} @@ -55,7 +56,8 @@ #' #'anom <- CST_Anomaly(exp = exp, obs = obs, cross = FALSE, memb = TRUE) #' -#'@seealso \code{\link[s2dv]{Ano_CrossValid}}, \code{\link[s2dv]{Clim}} and \code{\link{CST_Load}} +#'@seealso \code{\link[s2dv]{Ano_CrossValid}}, \code{\link[s2dv]{Clim}} and +#'\code{\link{CST_Load}} #' #'@import multiApply #'@importFrom s2dv InsertDim Clim Ano_CrossValid Reorder @@ -97,11 +99,6 @@ CST_Anomaly <- function(exp = NULL, obs = NULL, dim_anom = 'sdate', dim_obs <- dim(obs$data) dimnames_data <- names(dim_exp) # dim_anom - if (is.numeric(dim_anom) & length(dim_anom) == 1) { - warning("Parameter 'dim_anom' must be a character string and a numeric value will not be ", - "accepted in the next release. The corresponding dimension name is assigned.") - dim_anom <- dimnames_data[dim_anom] - } if (!is.character(dim_anom)) { stop("Parameter 'dim_anom' must be a character string.") } diff --git a/man/CST_Anomaly.Rd b/man/CST_Anomaly.Rd index 5ad20a47a6a13fd889c0934b3293c85f57f1b5fa..5a2784e1dfb9387a4c5a4b70c56b9d44b55ccca8 100644 --- a/man/CST_Anomaly.Rd +++ b/man/CST_Anomaly.Rd @@ -2,7 +2,8 @@ % Please edit documentation in R/CST_Anomaly.R \name{CST_Anomaly} \alias{CST_Anomaly} -\title{Anomalies relative to a climatology along selected dimension with or without cross-validation} +\title{Anomalies relative to a climatology along selected dimension with or without +cross-validation} \usage{ CST_Anomaly( exp = NULL, @@ -84,7 +85,8 @@ anom <- CST_Anomaly(exp = exp, obs = obs, cross = FALSE, memb = TRUE) } \seealso{ -\code{\link[s2dv]{Ano_CrossValid}}, \code{\link[s2dv]{Clim}} and \code{\link{CST_Load}} +\code{\link[s2dv]{Ano_CrossValid}}, \code{\link[s2dv]{Clim}} and +\code{\link{CST_Load}} } \author{ Perez-Zanon Nuria, \email{nuria.perez@bsc.es} diff --git a/tests/testthat/test-CST_Anomaly.R b/tests/testthat/test-CST_Anomaly.R index b4137015bd494d3cf1b911e5f214e87b38d5db97..a4c7f3f57778c5cfde40bb4b25a1a1490143d757 100644 --- a/tests/testthat/test-CST_Anomaly.R +++ b/tests/testthat/test-CST_Anomaly.R @@ -63,10 +63,9 @@ test_that("1. Input checks", { "Parameter 'exp' and 'obs' must have same dimension names in element 'data'." ) # dim_anom - expect_warning( + expect_error( CST_Anomaly(exp = exp, obs = obs, dim_anom = 3), - paste0("Parameter 'dim_anom' must be a character string and a numeric value will not be ", - "accepted in the next release. The corresponding dimension name is assigned.") + paste0("Parameter 'dim_anom' must be a character string.") ) expect_error( CST_Anomaly(exp = exp3, obs = obs3), @@ -113,7 +112,6 @@ test_that("1. Input checks", { ############################################## test_that("2. Output checks: dat", { - expect_equal( names(CST_Anomaly(exp, obs)), c("exp", "obs")