diff --git a/.Rbuildignore b/.Rbuildignore index 4212858235c6fea27a834c5e1a0012856a4ec6c9..0a2185526f4f30e029d88db4c83f416220c149e6 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,5 +1,6 @@ .*\.git$ .*\.gitignore$ +.*\.gitlab$ .*\.tar.gz$ .*\.pdf$ .*^(?!inst)\.nc$ @@ -10,7 +11,7 @@ README\.md$ vignettes .gitlab-ci.yml # unit tests should be ignored when building the package for CRAN -#^tests$ +^tests$ # CDO is not in windbuilder, so we can test the unit tests by winbuilder # but test-CDORemap.R and test-Load.R needs to be hidden #tests/testthat/test-CDORemap.R diff --git a/DESCRIPTION b/DESCRIPTION index bbfb47ce9d75e7be8dccc022421565c961f6607e..ec571f4ce6bd0ba036ae274b7e085237d6c19863 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: s2dv Title: A Set of Common Tools for Seasonal to Decadal Verification -Version: 1.4.1 +Version: 2.0.0 Authors@R: c( person("BSC-CNS", role = c("aut", "cph")), person("An-Chi", "Ho", , "an.ho@bsc.es", role = c("aut", "cre")), diff --git a/NEWS.md b/NEWS.md index a69b74c328eef248e7c6cdac9e839937fdb7feea..4ea74df7b20bb85cb94f3e81cdea5a1379c3551c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,23 @@ +# s2dv 2.0.0 (Release date: 2023-10-11) +The compability break happens at the parameter changes. All the functionality remains +the same but please pay attention to the parameter changes like name or default value if some error is raised. + +**Bugfixes** +- ColorBar() bug fix for an if condition for warning when var_limits is not provided +- PlotEquiMap() and PlotLayout() are able to plot all NAs maps now. + +**Development** +- ACC() remove parameter "space_dim". Use "lat_dim" and "lon_dim" instead. +- ACC(), Ano_CrossValid(), RMS(), Corr(), and RatioSDRMS() parameter "memb_dim" is optional for obs +- Change the default value of the parameter "dat_dim" in all the functions to NULL (except Ano_CrossValid(), Clim(), and Consistent_Trend()) +- Change parameter "conf.lev" to "alpha" in all appliable functions +- New function: GetProbs(), MSE(), MSSS() +- RPSS() efficiency improvement +- CDORemap() new parameter "ncores" to use multiple cores +- RMSSS(), RPSS(), CRPSS(), AbsBiasSS() have parameter "sig_method.type" to choose the test type of Random Walk test +- CRPSS() has non-cross-validation climatological forecast +- RPS() and RPSS() have new parameter "na.rm" to set the criterion of NA amount + # s2dv 1.4.1 (Release date: 2023-06-02) - Resubmit to CRAN because it was archived due to dependency issue. diff --git a/R/ACC.R b/R/ACC.R index 71544b98176ffbac1ce5f820816c5e3c442baa0c..131d15a0ae3d0d442aa6867193ff3900654a6c1f 100644 --- a/R/ACC.R +++ b/R/ACC.R @@ -84,7 +84,7 @@ #'} #'\item{p.val}{ #' The p-value with the same dimensions as ACC. Only present if -#' \code{pval = TRUE} and code{conftype = "parametric"}. +#' \code{pval = TRUE} and \code{conftype = "parametric"}. #'} #'\item{$sign}{ #' The statistical significance. Only present if \code{sign = TRUE}. diff --git a/R/InsertDim.R b/R/InsertDim.R index 533683d78f5c36863ed65d78e67983e8b8b1a0f2..ff88b581cda755db1c4519b8fb6d953ff146be12 100644 --- a/R/InsertDim.R +++ b/R/InsertDim.R @@ -8,8 +8,6 @@ #'@param lendim An integer indicating the length of the new dimension. #'@param name A character string indicating the name for the new dimension. #' The default value is NULL. -#'@param ncores An integer indicating the number of cores to use for parallel -#' computation. The default value is NULL. This parameter is deprecated now. #' #'@return An array as parameter 'data' but with the added named dimension. #' @@ -20,7 +18,7 @@ #' #'@import multiApply #'@export -InsertDim <- function(data, posdim, lendim, name = NULL, ncores = NULL) { +InsertDim <- function(data, posdim, lendim, name = NULL) { # Check inputs ## data @@ -61,9 +59,6 @@ InsertDim <- function(data, posdim, lendim, name = NULL, ncores = NULL) { stop("Parameter 'name' must be a character string.") } } - ## ncores - if (!missing("ncores")) - .warning("Argument 'ncores' is deprecated.", tag = '! Deprecation: ') ############################### # Calculate InsertDim diff --git a/R/MSE.R b/R/MSE.R index 97e4e828e88f85fea639fb63520b54da7366db6b..61cf3bcfb0586682c7e3f107848959742d33e268 100644 --- a/R/MSE.R +++ b/R/MSE.R @@ -63,13 +63,11 @@ #'# Synthetic data: #'exp1 <- array(rnorm(120), dim = c(dat = 3, sdate = 10, ftime = 4)) #'obs1 <- array(rnorm(80), dim = c(dat = 2, sdate = 10, ftime = 4)) -#'na <- floor(runif(10, min = 1, max = 80)) -#'obs1[na] <- NA #'res1 <- MSE(exp1, obs1, comp_dim = 'ftime', dat_dim = 'dat') #' #'exp2 <- array(rnorm(20), dim = c(sdate = 5, member = 4)) #'obs2 <- array(rnorm(10), dim = c(sdate = 5, member = 2)) -#'res2 <- MSE(exp3, obs3, memb_dim = 'member') +#'res2 <- MSE(exp2, obs2, memb_dim = 'member') #' #'@import multiApply #'@importFrom ClimProjDiags Subset diff --git a/R/StatSeasAtlHurr.R b/R/StatSeasAtlHurr.R index 9d0ec3865ace345c0f17407ee6f7294a081cd9b0..764215a4fe2081d4a2be80d184c4dcfe29063f7d 100644 --- a/R/StatSeasAtlHurr.R +++ b/R/StatSeasAtlHurr.R @@ -7,7 +7,7 @@ #'large (bounded by 30N-30S). The anomalies are for the JJASON season.\cr #'The estimated seasonal average is either 1) number of hurricanes, 2) number #'of tropical cyclones with lifetime >=48h or 3) power dissipation index -#'(PDI; in 10^11 m^3 s^{-2}).\cr +#'(PDI; in 10^11 m^3 s^(-2)).\cr #'The statistical models used in this function are described in references. #' #'@param atlano A numeric array with named dimensions of Atlantic sea surface diff --git a/man/ACC.Rd b/man/ACC.Rd index 4a4a5f21842dd412608de71856e5dc2b60a002f0..e1a8fb2e0d566e388c3b2afe210b9f95ea6c2f8f 100644 --- a/man/ACC.Rd +++ b/man/ACC.Rd @@ -113,7 +113,7 @@ A list containing the numeric arrays:\cr } \item{p.val}{ The p-value with the same dimensions as ACC. Only present if - \code{pval = TRUE} and code{conftype = "parametric"}. + \code{pval = TRUE} and \code{conftype = "parametric"}. } \item{$sign}{ The statistical significance. Only present if \code{sign = TRUE}. diff --git a/man/InsertDim.Rd b/man/InsertDim.Rd index 51418f0ba6624687dd12466e0edfeda3cfc98168..7a866a37c2887855ea5d5885f2d23a6569c8fbf2 100644 --- a/man/InsertDim.Rd +++ b/man/InsertDim.Rd @@ -4,7 +4,7 @@ \alias{InsertDim} \title{Add a named dimension to an array} \usage{ -InsertDim(data, posdim, lendim, name = NULL, ncores = NULL) +InsertDim(data, posdim, lendim, name = NULL) } \arguments{ \item{data}{An array to which the additional dimension to be added.} @@ -15,9 +15,6 @@ InsertDim(data, posdim, lendim, name = NULL, ncores = NULL) \item{name}{A character string indicating the name for the new dimension. The default value is NULL.} - -\item{ncores}{An integer indicating the number of cores to use for parallel -computation. The default value is NULL. This parameter is deprecated now.} } \value{ An array as parameter 'data' but with the added named dimension. diff --git a/man/MSE.Rd b/man/MSE.Rd index 291d08c2891d54fb76c7ba7b5d083c34ad21c620..cd58402766e777dddce5b27027b6cdf2e34fc798 100644 --- a/man/MSE.Rd +++ b/man/MSE.Rd @@ -91,12 +91,10 @@ res <- MSE(smooth_ano_exp, smooth_ano_obs, memb_dim = 'member', # Synthetic data: exp1 <- array(rnorm(120), dim = c(dat = 3, sdate = 10, ftime = 4)) obs1 <- array(rnorm(80), dim = c(dat = 2, sdate = 10, ftime = 4)) -na <- floor(runif(10, min = 1, max = 80)) -obs1[na] <- NA res1 <- MSE(exp1, obs1, comp_dim = 'ftime', dat_dim = 'dat') exp2 <- array(rnorm(20), dim = c(sdate = 5, member = 4)) obs2 <- array(rnorm(10), dim = c(sdate = 5, member = 2)) -res2 <- MSE(exp3, obs3, memb_dim = 'member') +res2 <- MSE(exp2, obs2, memb_dim = 'member') } diff --git a/man/StatSeasAtlHurr.Rd b/man/StatSeasAtlHurr.Rd index 965732291cd23fd966a15710a7446a366266dde7..16154675526e990ba618691882ddb81fc4899595 100644 --- a/man/StatSeasAtlHurr.Rd +++ b/man/StatSeasAtlHurr.Rd @@ -38,7 +38,7 @@ the tropical Atlantic (bounded by 10N-25N and 80W-20W) and the tropics at large (bounded by 30N-30S). The anomalies are for the JJASON season.\cr The estimated seasonal average is either 1) number of hurricanes, 2) number of tropical cyclones with lifetime >=48h or 3) power dissipation index -(PDI; in 10^11 m^3 s^{-2}).\cr +(PDI; in 10^11 m^3 s^(-2)).\cr The statistical models used in this function are described in references. } \examples{ diff --git a/s2dv-manual.pdf b/s2dv-manual.pdf deleted file mode 100644 index b4929e91355acf41086488ce94a23527e278f884..0000000000000000000000000000000000000000 Binary files a/s2dv-manual.pdf and /dev/null differ