diff --git a/.Rbuildignore b/.Rbuildignore index 67f31a7dc4f35e1e02ede961a483bd9258b1285a..6008b579d5dd55cd0c61aa4e05404c8437d91f3f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -10,7 +10,8 @@ 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 needs to be hidden +# but test-CDORemap.R and test-Load.R needs to be hidden #tests/testthat/test-CDORemap.R +#tests/testthat/test-Load.R diff --git a/DESCRIPTION b/DESCRIPTION index e8382cd0b7f07c91ba1223f52002a40090724ab1..3a79ba60fd249bcc9da43aa9aa078b9b3997566e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: s2dv Title: A Set of Common Tools for Seasonal to Decadal Verification -Version: 1.2.0 +Version: 1.3.0 Authors@R: c( person("BSC-CNS", role = c("aut", "cph")), person("An-Chi", "Ho", , "an.ho@bsc.es", role = c("aut", "cre")), @@ -10,7 +10,8 @@ Authors@R: c( person("Carlos", "Delgado", , "carlos.delgado@bsc.es", role = "ctb"), person("Llorenç", "Lledó", , "llorenc.lledo@bsc.es", role = "ctb"), person("Andrea", "Manrique", , "andrea.manrique@bsc.es", role = "ctb"), - person("Deborah", "Verfaillie", , "deborah.verfaillie@bsc.es", role = "ctb")) + person("Deborah", "Verfaillie", , "deborah.verfaillie@bsc.es", role = "ctb"), + person("Eva", "Rifà", , "eva.rifarovira@bsc.es", role = "ctb")) Description: The advanced version of package 's2dverification'. It is intended for 'seasonal to decadal' (s2d) climate forecast verification, but it can also be used in other kinds of forecasts or general climate analysis. @@ -19,17 +20,18 @@ Description: The advanced version of package 's2dverification'. It is from data retrieval, data post-processing, skill scores against observation, to visualization. Compared to 's2dverification', 's2dv' is more compatible with the package 'startR', able to use multiple cores for computation and - handle multi-dimensional arrays with a higher flexibility. + handle multi-dimensional arrays with a higher flexibility. The CDO version used + in development is 1.9.8. Depends: - maps, - methods, R (>= 3.6.0) Imports: abind, bigmemory, graphics, grDevices, + maps, mapproj, + methods, parallel, ClimProjDiags, stats, diff --git a/NEWS.md b/NEWS.md index d65a8240a76842468a0a509707745d2587b0f28f..c7daf9370c409791fe9679082ba30ce06f8cf347 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,15 @@ +# s2dv 1.3.0 (Release date: 2022-10-17) +- New functions: Bias, AbsBiasSS, CRPS, CRPSS +- split RPSS parameter 'weights' into 'weights_exp' and 'weights_ref' +- The warning message format is consistent; use internal function .warning() for all the cases +- PlotEquiMap() bugfixes when lon vector is not continuous +- PlotEquiMap() parameter "dots", "varu", "varv", and "contours" array latitude and longitude dimension order is flexible +- PlotLayout(): Add parameter to change subplot title size +- PlotLayout works with CSTools::PlotMostLikelyQuantileMap() +- Parameter "dat_dim" can be NULL in all functions +- Add "dat_dim" in RPS and RPSS to allow multiple datasets to be calculated +- DiffCorr: Add two-sided significance test. New param "test.type" to specify the one- or two-sided significance test. + # s2dv 1.2.0 (Release date: 2022-06-22) - Cluster(): Fix a bug of calculating nclusters ("K"): the function didn't use the whole data to calculate "K" if parameter "nclusters" is NULL.; Add missing output dimension names - Clim(): Correct the output dimensions for some cases; allow dat_dim to be NULL; obs doesn't need to have dat_dim. @@ -8,7 +20,7 @@ - PlotEquiMap(): Add useRaster = TRUE in image() if possible (i.e., latitude and longitude are regularly spaced.) - PlotEquiMap(): New parameters xlonshft ylatshft xlabels ylabels for self-defined axis - PlotEquiMap(): Flexible map longitude range -- New function: WeightCells, DiffCorr, ResidualCorr, RPS, RPSS +- New function: DiffCorr, ResidualCorr, RPS, RPSS - Clim() and MeanDims() efficiency improvement - CDORemap(): Add arbitrary time metadata to avoid cdo warning like "Warning (find_time_vars): Time variable >time< not found!" - CDORemap(): Stop printing messages from cdo command. diff --git a/R/DiffCorr.R b/R/DiffCorr.R index 89011074813405e4ec3bf38dcb1386d2300c65e5..1e07458989db3f40db83aa954abfc8b2b8929738 100644 --- a/R/DiffCorr.R +++ b/R/DiffCorr.R @@ -71,8 +71,10 @@ #' exp <- array(rnorm(1000), dim = c(lat = 3, lon = 2, member = 10, sdate = 50)) #' obs <- array(rnorm(1000), dim = c(lat = 3, lon = 2, sdate = 50)) #' ref <- array(rnorm(1000), dim = c(lat = 3, lon = 2, member = 10, sdate = 50)) -#' res_two.sided_sign <- DiffCorr(exp, obs, ref, memb_dim = 'member', test.type = 'two-sided', alpha = 0.05) -#' res_one.sided_pval <- DiffCorr(exp, obs, ref, memb_dim = 'member', test.type = 'one-sided', alpha = NULL) +#' res_two.sided_sign <- DiffCorr(exp, obs, ref, memb_dim = 'member', +#' test.type = 'two-sided', alpha = 0.05) +#' res_one.sided_pval <- DiffCorr(exp, obs, ref, memb_dim = 'member', +#' test.type = 'one-sided', alpha = NULL) #' #'@import multiApply #'@export diff --git a/man/DiffCorr.Rd b/man/DiffCorr.Rd index e907d3b5251f0885b80f76234c94b00835ae630d..d127af817a8543ad478fad4114df93fa95ca046b 100644 --- a/man/DiffCorr.Rd +++ b/man/DiffCorr.Rd @@ -97,8 +97,10 @@ the time series (Zwiers and von Storch, 1995). exp <- array(rnorm(1000), dim = c(lat = 3, lon = 2, member = 10, sdate = 50)) obs <- array(rnorm(1000), dim = c(lat = 3, lon = 2, sdate = 50)) ref <- array(rnorm(1000), dim = c(lat = 3, lon = 2, member = 10, sdate = 50)) -res_two.sided_sign <- DiffCorr(exp, obs, ref, memb_dim = 'member', test.type = 'two-sided', alpha = 0.05) -res_one.sided_pval <- DiffCorr(exp, obs, ref, memb_dim = 'member', test.type = 'one-sided', alpha = NULL) +res_two.sided_sign <- DiffCorr(exp, obs, ref, memb_dim = 'member', + test.type = 'two-sided', alpha = 0.05) +res_one.sided_pval <- DiffCorr(exp, obs, ref, memb_dim = 'member', + test.type = 'one-sided', alpha = NULL) } \references{ diff --git a/man/s2dv-package.Rd b/man/s2dv-package.Rd index 3c98a95154225719ceb248570f232b02e9434545..f0c407d5652edc0bdff367888e72101da43d7f7f 100644 --- a/man/s2dv-package.Rd +++ b/man/s2dv-package.Rd @@ -6,7 +6,7 @@ \alias{s2dv-package} \title{s2dv: A Set of Common Tools for Seasonal to Decadal Verification} \description{ -The advanced version of package 's2dverification'. It is intended for 'seasonal to decadal' (s2d) climate forecast verification, but it can also be used in other kinds of forecasts or general climate analysis. This package is specially designed for the comparison between the experimental and observational datasets. The functionality of the included functions covers from data retrieval, data post-processing, skill scores against observation, to visualization. Compared to 's2dverification', 's2dv' is more compatible with the package 'startR', able to use multiple cores for computation and handle multi-dimensional arrays with a higher flexibility. +The advanced version of package 's2dverification'. It is intended for 'seasonal to decadal' (s2d) climate forecast verification, but it can also be used in other kinds of forecasts or general climate analysis. This package is specially designed for the comparison between the experimental and observational datasets. The functionality of the included functions covers from data retrieval, data post-processing, skill scores against observation, to visualization. Compared to 's2dverification', 's2dv' is more compatible with the package 'startR', able to use multiple cores for computation and handle multi-dimensional arrays with a higher flexibility. The CDO version used in development is 1.9.8. } \references{ \url{https://earth.bsc.es/gitlab/es/s2dv/} @@ -36,6 +36,7 @@ Other contributors: \item Llorenç Lledó \email{llorenc.lledo@bsc.es} [contributor] \item Andrea Manrique \email{andrea.manrique@bsc.es} [contributor] \item Deborah Verfaillie \email{deborah.verfaillie@bsc.es} [contributor] + \item Eva Rifà \email{eva.rifarovira@bsc.es} [contributor] } } diff --git a/s2dv-manual.pdf b/s2dv-manual.pdf index 2b6da42257033ded7f67d7307378f372ae3a10fe..b4929e91355acf41086488ce94a23527e278f884 100644 Binary files a/s2dv-manual.pdf and b/s2dv-manual.pdf differ