diff --git a/DESCRIPTION b/DESCRIPTION index bde7bca03c19468236c24e7a21984aff0eb7476e..9539b412ccb29b0f064dab043437d097556238a1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,7 +34,7 @@ Imports: parallel, bigmemory, NbClust, - SpecsVerification (< 1.0.0), + SpecsVerification (>= 0.5.0), plyr Suggests: easyVerification diff --git a/NAMESPACE b/NAMESPACE index 55775684fab85636efd75280c178115c2933dcff..dd6ae260148fafced692f92b4adb9e098f09e162 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,7 +1,2 @@ exportPattern("^[^\\.]") -import(ncdf4, GEOmap, geomapdata, mapproj, abind, parallel, bigmemory, SpecsVerification, plyr, methods) -importFrom("grDevices", "colorRampPalette", "dev.off", "gray", "postscript", "rainbow") -importFrom("graphics", "abline", "axis", "box", "contour", "filled.contour", "image", "layout", "legend", "lines", "matplot", "matpoints", "par", "plot", "points", "polygon", "rect", "segments", "text", "title") -importFrom("stats", "IQR", "acf", "confint", "cor", "lm", "mad", "median", "na.omit", "na.pass", "pf", "qchisq", "qnorm", "qt", "quantile", "rnorm", "runif", "sd", "spectrum", "ts", "window") -importFrom("utils", "data") -importFrom("maps", "map") +import(abind, bigmemory, GEOmap, geomapdata, graphics, grDevices, mapproj, maps, methods, ncdf4, parallel, plyr, stats, SpecsVerification) diff --git a/R/PlotEquiMap.R b/R/PlotEquiMap.R index 84173ec8a740db7b45c3c7372bb68fe9488970c9..b8b7bd60fc89d6bd8d341f2162f35f280c6729f1 100644 --- a/R/PlotEquiMap.R +++ b/R/PlotEquiMap.R @@ -385,7 +385,7 @@ PlotEquiMap <- function(var, lon, lat, varu = NULL, varv = NULL, #library(GEOmap) #library(geomapdata) #library(maps) - data(coastmap, package = 'GEOmap', envir = environment()) + utils::data(coastmap, package = 'GEOmap', envir = environment()) # # Input arguments # ~~~~~~~~~~~~~~~~~ diff --git a/R/UltimateBrier.R b/R/UltimateBrier.R index a5994e9f6f5a6d5e7e4081bf1e2f7d71629ed589..23743b7719365b74d5722908b687671f5912fffe 100644 --- a/R/UltimateBrier.R +++ b/R/UltimateBrier.R @@ -123,14 +123,18 @@ UltimateBrier <- function(ano_exp, ano_obs, posdatasets = 1, posmemb = 2, size_ens_ref <- prod(dim(ano_obs)[c(posmemb, posdates)]) f <- function(x) { ens_ref <- matrix(do.call("[", c(list(x = x), indices_obs)), size_ens_ref, size_ens_ref, byrow = TRUE) - sapply(c(thr, 1), function(tau) FairBrierSs(t(do.call("[", c(list(x = x), indices_exp))), ens_ref, do.call("[", c(list(x = x), indices_obs)), tau)$bss) + sapply(c(thr, 1), function(tau) { + FairBrierSs(t(do.call("[", c(list(x = x), indices_exp))) > tau, + ens_ref > tau, + do.call("[", c(list(x = x), indices_obs)) > tau)['skillscore'] + }) } } else { if (type == 'FairEnsembleBS') { - f <- function(x) sapply(c(thr, 1), function(tau) mean(FairBrier(t(do.call("[", c(list(x = x), indices_exp))), do.call("[", c(list(x = x), indices_obs)), tau), na.rm = TRUE)) + f <- function(x) sapply(c(thr, 1), function(tau) mean(FairBrier(t(do.call("[", c(list(x = x), indices_exp))) > tau, do.call("[", c(list(x = x), indices_obs)) > tau), na.rm = TRUE)) } else { if (type == 'BS') { - f <- function(x) as.vector(BrierScoreDecomposition(do.call("[", c(list(x = x), indices_exp)), do.call("[", c(list(x = x), indices_obs)))) + f <- function(x) as.vector(BrierScoreDecomposition(do.call("[", c(list(x = x), indices_exp)), do.call("[", c(list(x = x), indices_obs)))[1, ]) } else if (type == 'FairStartDatesBS') { f <- function(x) unlist(BrierScore(do.call("[", c(list(x = x), indices_obs)), do.call("[", c(list(x = x), indices_exp)))[c('rel', 'res', 'unc')], use.names = FALSE) } else if (type == 'BSS') { diff --git a/R/Utils.R b/R/Utils.R index d5e3b1495521875527f58d21c1ad074f799f4811..806ad92d448b709655a06d34aae3d28f3f7f4310 100644 --- a/R/Utils.R +++ b/R/Utils.R @@ -1069,7 +1069,7 @@ } right_known <- head(strsplit(file_name_with_globs, '*', fixed = TRUE)[[1]], 1) right_known_no_tags <- .ConfigReplaceVariablesInString(right_known, replace_values) - path_with_globs_rx <- glob2rx(paste0(path_with_globs, right_known_no_tags)) + path_with_globs_rx <- utils::glob2rx(paste0(path_with_globs, right_known_no_tags)) match <- regexpr(gsub('$', '', path_with_globs_rx, fixed = TRUE), paste0(actual_path, file_name)) if (match != 1) { stop("Incorrect parameters to replace glob expressions. The path with expressions does not match the actual path.") @@ -1079,7 +1079,7 @@ file_name_with_globs <- sub(right_known, '/*', file_name_with_globs) } } - path_with_globs_rx <- glob2rx(path_with_globs) + path_with_globs_rx <- utils::glob2rx(path_with_globs) values_to_replace <- c() tags_to_replace_starts <- c() tags_to_replace_ends <- c() diff --git a/man/s2dverification.Rd b/man/s2dverification.Rd index 32a6b9453e9bbfa4e38c07cec0050b6d8d13d0af..6024bf6060243c097f506e18fb452292c75c7d7e 100644 --- a/man/s2dverification.Rd +++ b/man/s2dverification.Rd @@ -11,7 +11,7 @@ Set of tools to verify forecasts through the computation of typical prediction s Package: \tab s2dverification\cr Type: \tab Package\cr Version: \tab 2.8.0\cr -Date: \tab 2017-02-10\cr +Date: \tab 2017-02-13\cr License: \tab LGPLv3\cr } Check an overview of the package functionalities and its modules at \url{https://earth.bsc.es/gitlab/es/s2dverification/wikis/home}. diff --git a/s2dverification-manual.pdf b/s2dverification-manual.pdf index 2d4441ff264369411a34568f19a7c8090e5e28a1..1edc7d90bd00b40ca12eff04f81cc79c11ec88bf 100644 Binary files a/s2dverification-manual.pdf and b/s2dverification-manual.pdf differ