diff --git a/.Rbuildignore b/.Rbuildignore index 587c9dc9b31152e4bcbfc49093d6902cce4b6207..15222c0c49a1e16886a535ce490d47940170e23c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -5,5 +5,10 @@ ./.nc$ .*^(?!data)\.RData$ .*\.gitlab-ci.yml$ -#^tests$ -^inst/doc/$ +^tests$ +#^inst/doc$ +^inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF100\.R$ +^inst/doc/UseCase1_WindEvent_March2018\.R$ +^inst/doc/UseCase2_PrecipitationDownscaling_RainFARM_RF4\.R$ +^inst/doc/UseCase3_data_preparation_SCHEME_model\.R$ +^inst/doc/launch_UseCase2_PrecipitationDownscaling_RF4\.sh$ diff --git a/DESCRIPTION b/DESCRIPTION index 30fe88f70995ca977bede942580bdff051eecceb..2cb6f17e9a939c77e5f74706db509c3b78098a49 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,9 @@ Package: CSTools Title: Assessing Skill of Climate Forecasts on Seasonal-to-Decadal Timescales -Version: 4.0.1 +Version: 4.1.0 Authors@R: c( - person("Nuria", "Perez-Zanon", , "nuria.perez@bsc.es", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8568-3071")), + person("Nuria", "Perez-Zanon", , "nuria.perez@bsc.es", role = "aut", comment = c(ORCID = "0000-0001-8568-3071")), person("Louis-Philippe", "Caron", , "louis-philippe.caron@bsc.es", role = "aut", comment = c(ORCID = "0000-0001-5221-0147")), person("Carmen", "Alvarez-Castro", , "carmen.alvarez-castro@cmcc.it", role = "aut", comment = c(ORCID = "0000-0002-9958-010X")), person("Lauriane", "Batte", , "lauriane.batte@meteo.fr", role = "aut"), @@ -16,6 +16,7 @@ Authors@R: c( person("Bert", "van Schaeybroeck", , "bertvs@meteo.be", role = "aut"), person("Veronica", "Torralba", , "veronica.torralba@bsc.es", role = "aut"), person("Deborah", "Verfaillie", , "deborah.verfaillie@bsc.es", role = "aut"), + person("Eva", "Rifà", , "eva.rifarovira@bsc.es", role = c("cre", "ctb")), person("Filippo", "Cali Quaglia", , "filippo.caliquaglia@gmail.com", role = "ctb"), person("Maria M.", "Chaves-Montero", , "mariadm.chaves@cmcc.it", role = "ctb"), person("Chihchung", "Chou", , "chihchung.chou@bsc.es", role = "ctb"), @@ -33,6 +34,7 @@ Authors@R: c( person("Francesc", "Roura-Adserias", , "francesc.roura@bsc.es", role = "ctb"), person("Silvia", "Terzago", , "s.terzago@isac.cnr.it", role = "ctb"), person("Danila", "Volpi", , "d.volpi@isac.cnr.it", role = "ctb"), + person("An-Chi", "Ho", , "an.ho@bsc.es", role = "ctb"), person("Victoria", "Agudetse", , "victoria.agudetse@bsc.es", role = "ctb"), person("BSC-CNS", role = c("cph"))) Description: Exploits dynamical seasonal forecasts in order to provide @@ -42,6 +44,7 @@ Description: Exploits dynamical seasonal forecasts in order to provide multivariate verification, as well as basic and advanced tools to obtain tailored products. This package was developed in the context of the ERA4CS project MEDSCOPE and the H2020 S2S4E project. + Pérez-Zanón et al. (2022) . Doblas-Reyes et al. (2005) . Mishra et al. (2018) . Sanchez-Garcia et al. (2019) . diff --git a/NEWS.md b/NEWS.md index 887db24ed55d6fee9dc4d5252264565129aac7e0..b1403786ad0eb1193f366ce3f5dbd61114ebcc74 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,18 @@ -### CSTools X.X.X -**Submission date to CRAN: DD-MM-YYYY** - -- Enhancements:ç +### CSTools 4.1.0 +**Submission date to CRAN: 25-10-2022** +- New features: + + Dependency on package 's2dverification' is changed to 's2dv' + CST_BiasCorrection new parameters 'memb_dim', 'sdate_dim', 'ncores' + + CST_Calibration is able to calibrate forecast with new parameter 'exp_cor' + + CST_QuantileMapping uses cross-validation and provides option to remove NAs; new parameters 'memb_dim', 'sdate_dim', 'window_dim' and 'na.rm'; 'sample_dim' and 'sample_length' are removed + + s2dv_cube() new parameter 'time_dim' + +- Fixes: + + as.s2dv_cube() detects latitude and longitude structure in startR_array object + + Data correction: 'lonlat_data' is renamed to 'lonlat_temp'; 'lonlat_prec' is corrected by one-day shift + + Typo and parameter correction in vignette 'MostLikelyTercile_vignette' + + Figure and result correction in vignette 'RainFARM_vignette' + + PlotMostLikelyQuantileMap() works with s2dv::PlotLayout ### CSTools 4.0.1 **Submission date to CRAN: 05-10-2021** diff --git a/R/CST_EnsClustering.R b/R/CST_EnsClustering.R index 6d5b442594acebe2e119d15d8966c61b6d33e033..6b1f335e96df89b77c6e0ff8371fff2bc93a53ea 100644 --- a/R/CST_EnsClustering.R +++ b/R/CST_EnsClustering.R @@ -73,32 +73,32 @@ #' \code{$lon} (selected longitudes of output fields), #' \code{$lat} (selected longitudes of output fields). #' @examples +#'\donttest{ #' exp <- lonlat_temp$exp #' # Example 1: Cluster on all start dates, members and models #' res <- CST_EnsClustering(exp, numclus = 3, #' cluster_dim = c("member", "dataset", "sdate")) -#' iclus = res$cluster[2, 1, 3] +#' iclus <- res$cluster[2, 1, 3] #' #' #print(paste("Cluster of 2. member, 1. dataset, 3. sdate:", iclus)) #' #print(paste("Frequency (numerosity) of cluster (", iclus, ") :", res$freq[iclus])) -#'\donttest{ #' s2dv::PlotEquiMap(res$repr_field[iclus, , ], exp$lon, exp$lat, #' filled.continents = FALSE, #' toptitle = paste("Representative field of cluster", iclus)) -#'} +#' #' # Example 2: Cluster on members retaining 4 EOFs during #' # preliminary dimensional reduction -#' #' res <- CST_EnsClustering(exp, numclus = 3, numpcs = 4, cluster_dim = "member") +#' #' # Example 3: Cluster on members, retain 80% of variance during #' # preliminary dimensional reduction -#' #' res <- CST_EnsClustering(exp, numclus = 3, variance_explained = 80, #' cluster_dim = "member") -#' # Example 4: Compute percentile in time #' +#' # Example 4: Compute percentile in time #' res <- CST_EnsClustering(exp, numclus = 3, time_percentile = 90, #' time_moment = "perc", cluster_dim = "member") +#'} #' #'@export CST_EnsClustering <- function(exp, time_moment = "mean", numclus = NULL, diff --git a/R/CST_MultiMetric.R b/R/CST_MultiMetric.R index aa4ff344b589d4bb82dd4bedba99f4692471cabf..93b7392df34e82eba0cff2090cd4b3ca1675588a 100644 --- a/R/CST_MultiMetric.R +++ b/R/CST_MultiMetric.R @@ -15,7 +15,7 @@ #'@return an object of class \code{s2dv_cube} containing the statistics of the selected metric in the element \code{$data} which is a list of arrays: for the metric requested and others for statistics about its signeificance. The arrays have two dataset dimensions equal to the 'dataset' dimension in the \code{exp$data} and \code{obs$data} inputs. If \code{multimodel} is TRUE, the first position in the first 'nexp' dimension correspons to the Multi-Model Mean. #'@seealso \code{\link[s2dv]{Corr}}, \code{\link[s2dv]{RMS}}, \code{\link[s2dv]{RMSSS}} and \code{\link{CST_Load}} #'@references -#'Mishra, N., Prodhomme, C., & Guemas, V. (n.d.). Multi-Model Skill Assessment of Seasonal Temperature and Precipitation Forecasts over Europe, 29-31.\url{https://link.springer.com/10.1007/s00382-018-4404-z} +#'Mishra, N., Prodhomme, C., & Guemas, V. (n.d.). Multi-Model Skill Assessment of Seasonal Temperature and Precipitation Forecasts over Europe, 29-31.\url{https://link.springer.com/article/10.1007/s00382-018-4404-z} #' #'@importFrom s2dv MeanDims Reorder Corr RMS RMSSS InsertDim #'@import abind @@ -75,7 +75,7 @@ CST_MultiMetric <- function(exp, obs, metric = "correlation", multimodel = TRUE, #'@return a list of arrays containing the statistics of the selected metric in the element \code{$data} which is a list of arrays: for the metric requested and others for statistics about its signeificance. The arrays have two dataset dimensions equal to the 'dataset' dimension in the \code{exp$data} and \code{obs$data} inputs. If \code{multimodel} is TRUE, the greatest position in the first dimension correspons to the Multi-Model Mean. #'@seealso \code{\link[s2dv]{Corr}}, \code{\link[s2dv]{RMS}}, \code{\link[s2dv]{RMSSS}} and \code{\link{CST_Load}} #'@references -#'Mishra, N., Prodhomme, C., & Guemas, V. (n.d.). Multi-Model Skill Assessment of Seasonal Temperature and Precipitation Forecasts over Europe, 29-31.\url{https://link.springer.com/10.1007/s00382-018-4404-z} +#'Mishra, N., Prodhomme, C., & Guemas, V. (n.d.). Multi-Model Skill Assessment of Seasonal Temperature and Precipitation Forecasts over Europe, 29-31.\url{https://link.springer.com/article/10.1007/s00382-018-4404-z} #' #'@importFrom s2dv MeanDims Reorder Corr RMS RMSSS InsertDim #'@import abind diff --git a/R/CST_QuantileMapping.R b/R/CST_QuantileMapping.R index a4e4a9d601d504a27edc5128d571796ee45e87bf..edb2fb895b4c32e754349a979403ec1e522c067e 100644 --- a/R/CST_QuantileMapping.R +++ b/R/CST_QuantileMapping.R @@ -36,17 +36,18 @@ #'@examples #'# Use synthetic data #'exp <- NULL -#'exp$data <- 1 : c(1 * 10 * 20 * 60 * 6 * 7) -#'dim(exp$data) <- c(dataset = 1, member = 10, sdate = 20, ftime = 60 , -#' lat = 6, lon = 7) +#'exp$data <- 1 : c(1 * 3 * 5 * 4 * 3 * 2) +#'dim(exp$data) <- c(dataset = 1, member = 3, sdate = 5, ftime = 4, +#' lat = 3, lon = 2) #'class(exp) <- 's2dv_cube' -#'obs$data <- 101 : c(100 + 1 * 1 * 20 * 60 * 6 * 7) -#'dim(obs$data) <- c(dataset = 1, member = 1, sdate = 20, ftime = 60 , -#' lat = 6, lon = 7) +#'obs$data <- 101 : c(100 + 1 * 1 * 5 * 4 * 3 * 2) +#'dim(obs$data) <- c(dataset = 1, member = 1, sdate = 5, ftime = 4, +#' lat = 3, lon = 2) #'class(obs) <- 's2dv_cube' #'res <- CST_QuantileMapping(exp, obs) #' #'# Use data in package +#'\donttest{ #'exp <- lonlat_temp$exp #'exp$data <- exp$data[, , 1:4, , 1:2, 1:3] #'dim(exp$data) <- c(dataset = 1, member = 15, sdate = 4, ftime = 3, @@ -60,6 +61,7 @@ #'dim(exp_cor$data) <- c(dataset = 1, member = 1, sdate = 2, ftime = 3, #' lat = 2, lon = 3) #'res <- CST_QuantileMapping(exp, obs, exp_cor, window_dim = 'ftime') +#'} #' #'@import qmap #'@import multiApply @@ -141,15 +143,16 @@ CST_QuantileMapping <- function(exp, obs, exp_cor = NULL, sdate_dim = 'sdate', #'@seealso \code{\link[qmap]{fitQmap}} and \code{\link[qmap]{doQmap}} #'@examples #'# Use synthetic data -#'exp <- 1 : c(1 * 10 * 20 * 60 * 6 * 7) -#'dim(exp) <- c(dataset = 1, member = 10, sdate = 20, ftime = 60 , -#' lat = 6, lon = 7) -#'class(exp) <- 's2dv_cube' -#'obs <- 101 : c(100 + 1 * 1 * 20 * 60 * 6 * 7) -#'dim(obs) <- c(dataset = 1, member = 1, sdate = 20, ftime = 60 , -#' lat = 6, lon = 7) +#'exp <- 1 : c(1 * 3 * 5 * 4 * 3 * 2) +#'dim(exp) <- c(dataset = 1, member = 3, sdate = 5, ftime = 4, +#' lat = 3, lon = 2) +#'obs <- 101 : c(100 + 1 * 1 * 5 * 4 * 3 * 2) +#'dim(obs) <- c(dataset = 1, member = 1, sdate = 5, ftime = 4, +#' lat = 3, lon = 2) #'res <- QuantileMapping(exp, obs) +#' #'# Use data in package +#'\donttest{ #'exp <- lonlat_temp$exp$data[, , 1:4, , 1:2, 1:3] #'dim(exp) <- c(dataset = 1, member = 15, sdate = 4, ftime = 3, #' lat = 2, lon = 3) @@ -160,6 +163,7 @@ CST_QuantileMapping <- function(exp, obs, exp_cor = NULL, sdate_dim = 'sdate', #'dim(exp_cor) <- c(dataset = 1, member = 1, sdate = 2, ftime = 3, #' lat = 2, lon = 3) #'res <- QuantileMapping(exp, obs, exp_cor, window_dim = 'ftime') +#'} #' #'@import qmap #'@import multiApply diff --git a/R/PlotCombinedMap.R b/R/PlotCombinedMap.R index 6379179b1838a8ea67f9ae3eefaaebef95edd730..b6a52cb3c870d5c8cfab6ec526e5e818c5d066b2 100644 --- a/R/PlotCombinedMap.R +++ b/R/PlotCombinedMap.R @@ -23,6 +23,10 @@ #'@param bar_titles Optional vector of character strings providing the titles to be shown on top of each of the colour bars. #'@param legend_scale Scale factor for the size of the colour bar labels. Takes 1 by default. #'@param cex_bar_titles Scale factor for the sizes of the bar titles. Takes 1.5 by default. +#'@param plot_margin Numeric vector of length 4 for the margin sizes in the +#' following order: bottom, left, top, and right. If not specified, use the +#' default of par("mar"), c(5.1, 4.1, 4.1, 2.1). Used as 'margin_scale' in +#' s2dv::PlotEquiMap. #'@param fileout File where to save the plot. If not specified (default) a graphics device will pop up. Extensions allowed: eps/ps, jpeg, png, pdf, bmp and tiff #'@param width File width, in the units specified in the parameter size_units (inches by default). Takes 8 by default. #'@param height File height, in the units specified in the parameter size_units (inches by default). Takes 5 by default. @@ -81,7 +85,7 @@ PlotCombinedMap <- function(maps, lon, lat, dots = NULL, bar_titles = NULL, legend_scale = 1, cex_bar_titles = 1.5, - plot_margin = NULL, bar_margin = rep(0, 4), + plot_margin = NULL, fileout = NULL, width = 8, height = 5, size_units = 'in', res = 100, drawleg = T, ...) { @@ -340,7 +344,7 @@ PlotCombinedMap <- function(maps, lon, lat, PlotEquiMap(var = ml_map, lon = lon, lat = lat, brks = tbrks, cols = tcols, drawleg = FALSE, - filled.continents = FALSE, dots = dots, mar = plot_margin, ...) + filled.continents = FALSE, dots = dots, margin_scale = plot_margin, ...) #---------------------- # Add overplot on top diff --git a/R/as.s2dv_cube.R b/R/as.s2dv_cube.R index ac4cb7140c0916fd638ce44249a7958c865b2997..5f31ad31f6242fcfaa5bbe48e22ac27700b419c1 100644 --- a/R/as.s2dv_cube.R +++ b/R/as.s2dv_cube.R @@ -115,7 +115,7 @@ as.s2dv_cube <- function(object) { } } - } else if (class(object) == 'startR_array') { + } else if (inherits(object, 'startR_array')) { result <- list() result$data <- as.vector(object) dim(result$data) <- dim(object) @@ -123,7 +123,7 @@ as.s2dv_cube <- function(object) { dat_attr_names <- names(attributes(object)$Variables$dat1) common_attr_names <- names(attributes(object)$Variables$common) # $lon - known_lon_names <- s2dv:::.KnownLonNames() + known_lon_names <- utils::getFromNamespace(".KnownLonNames", "s2dv")() if (!is.null(dat_attr_names[which(dat_attr_names %in% known_lon_names)]) & !identical(dat_attr_names[which(dat_attr_names %in% known_lon_names)], character(0))) { result$lon <- attributes(object)$Variables$dat1[[dat_attr_names[which(dat_attr_names %in% known_lon_names)]]] @@ -135,7 +135,7 @@ as.s2dv_cube <- function(object) { result$lon <- NULL } # $lat - known_lat_names <- s2dv:::.KnownLatNames() + known_lat_names <- utils::getFromNamespace(".KnownLatNames", "s2dv")() if (!is.null(dat_attr_names[which(dat_attr_names %in% known_lat_names)]) & !identical(dat_attr_names[which(dat_attr_names %in% known_lat_names)], character(0))) { result$lat <- attributes(object)$Variables$dat1[[dat_attr_names[which(dat_attr_names %in% known_lat_names)]]] diff --git a/README.md b/README.md index 40bc01baca07b03e80663c0acd35fc309e5db0c0..bc54095ee7c0ac1cdc8c56fedac625b24fb33dd5 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ The Climate Services Tools, CSTools, is an easy-to-use R package designed and bu This package was developed in the context of the ERA4CS project MEDSCOPE and the H2020 S2S4E project. This GitLab project allows you to monitor its progress and to interact with other developers via the Issues section. -A scientific publication including use cases is under-review in the Geoscientific Model Development Journal and it can be cited as follows: +A scientific publication including use cases was published in the Geoscientific Model Development Journal, and it can be cited as follows: +> Pérez-Zanón, N., Caron, L.-P., Terzago, S., Van Schaeybroeck, B., Lledó, L., Manubens, N., Roulin, E., Alvarez-Castro, M. C., Batté, L., Bretonnière, P.-A., Corti, S., Delgado-Torres, C., Domínguez, M., Fabiano, F., Giuntoli, I., von Hardenberg, J., Sánchez-García, E., Torralba, V., and Verfaillie, D.: Climate Services Toolbox (CSTools) v4.0: from climate forecasts to climate forecast information, Geosci. Model Dev., 15, 6115–6142, https://doi.org/10.5194/gmd-15-6115-2022, 2022. -> Pérez-Zanón, N., Caron, L.-P., Terzago, S., Van Schaeybroeck, B., Lledó, L., Manubens, N., Roulin, E., Alvarez-Castro, M. C., Batté, L., Delgado-Torres, C., Domínguez, M., von Hardenberg, J., Sánchez-García, E., Torralba, V., and Verfaillie, D.: The CSTools (v4.0) Toolbox: from Climate Forecasts to Climate Forecast Information, Geosci. Model Dev. Discuss. [preprint], https://doi.org/10.5194/gmd-2021-368, in review, 2021. On-line resources ----------------- diff --git a/man/CST_EnsClustering.Rd b/man/CST_EnsClustering.Rd index 7ff820807993034692dc7b6f21938732f7576e35..83f5e7a1a1b17c3217044ffaecc09ccb383fd3de 100644 --- a/man/CST_EnsClustering.Rd +++ b/man/CST_EnsClustering.Rd @@ -99,32 +99,32 @@ the maximum distance between a member in a cluster and the cluster centroid deviation for each cluster (i.e. how much the cluster is compact). } \examples{ +\donttest{ exp <- lonlat_temp$exp # Example 1: Cluster on all start dates, members and models res <- CST_EnsClustering(exp, numclus = 3, cluster_dim = c("member", "dataset", "sdate")) -iclus = res$cluster[2, 1, 3] +iclus <- res$cluster[2, 1, 3] #print(paste("Cluster of 2. member, 1. dataset, 3. sdate:", iclus)) #print(paste("Frequency (numerosity) of cluster (", iclus, ") :", res$freq[iclus])) -\donttest{ s2dv::PlotEquiMap(res$repr_field[iclus, , ], exp$lon, exp$lat, filled.continents = FALSE, toptitle = paste("Representative field of cluster", iclus)) -} + # Example 2: Cluster on members retaining 4 EOFs during # preliminary dimensional reduction - res <- CST_EnsClustering(exp, numclus = 3, numpcs = 4, cluster_dim = "member") + # Example 3: Cluster on members, retain 80\% of variance during # preliminary dimensional reduction - res <- CST_EnsClustering(exp, numclus = 3, variance_explained = 80, cluster_dim = "member") -# Example 4: Compute percentile in time +# Example 4: Compute percentile in time res <- CST_EnsClustering(exp, numclus = 3, time_percentile = 90, time_moment = "perc", cluster_dim = "member") +} } \author{ diff --git a/man/CST_MultiMetric.Rd b/man/CST_MultiMetric.Rd index c748b4f00ee740fed9bed3f6a7ebf3b7a2d45a86..5590ab893945db323d703490692be975c704ceed 100644 --- a/man/CST_MultiMetric.Rd +++ b/man/CST_MultiMetric.Rd @@ -60,7 +60,7 @@ a <- CST_MultiMetric(exp, obs, metric = 'rmsss') } } \references{ -Mishra, N., Prodhomme, C., & Guemas, V. (n.d.). Multi-Model Skill Assessment of Seasonal Temperature and Precipitation Forecasts over Europe, 29-31.\url{https://link.springer.com/10.1007/s00382-018-4404-z} +Mishra, N., Prodhomme, C., & Guemas, V. (n.d.). Multi-Model Skill Assessment of Seasonal Temperature and Precipitation Forecasts over Europe, 29-31.\url{https://link.springer.com/article/10.1007/s00382-018-4404-z} } \seealso{ \code{\link[s2dv]{Corr}}, \code{\link[s2dv]{RMS}}, \code{\link[s2dv]{RMSSS}} and \code{\link{CST_Load}} diff --git a/man/CST_QuantileMapping.Rd b/man/CST_QuantileMapping.Rd index af4f68cc546c9a38dc1f6c3e8f599d9013755e91..71b32da9f87dbca3d93f1c6b33736bb42ccd2a7a 100644 --- a/man/CST_QuantileMapping.Rd +++ b/man/CST_QuantileMapping.Rd @@ -63,17 +63,18 @@ applied to the experiment itself or to a provided forecast. \examples{ # Use synthetic data exp <- NULL -exp$data <- 1 : c(1 * 10 * 20 * 60 * 6 * 7) -dim(exp$data) <- c(dataset = 1, member = 10, sdate = 20, ftime = 60 , - lat = 6, lon = 7) +exp$data <- 1 : c(1 * 3 * 5 * 4 * 3 * 2) +dim(exp$data) <- c(dataset = 1, member = 3, sdate = 5, ftime = 4, + lat = 3, lon = 2) class(exp) <- 's2dv_cube' -obs$data <- 101 : c(100 + 1 * 1 * 20 * 60 * 6 * 7) -dim(obs$data) <- c(dataset = 1, member = 1, sdate = 20, ftime = 60 , - lat = 6, lon = 7) +obs$data <- 101 : c(100 + 1 * 1 * 5 * 4 * 3 * 2) +dim(obs$data) <- c(dataset = 1, member = 1, sdate = 5, ftime = 4, + lat = 3, lon = 2) class(obs) <- 's2dv_cube' res <- CST_QuantileMapping(exp, obs) # Use data in package +\donttest{ exp <- lonlat_temp$exp exp$data <- exp$data[, , 1:4, , 1:2, 1:3] dim(exp$data) <- c(dataset = 1, member = 15, sdate = 4, ftime = 3, @@ -87,6 +88,7 @@ exp_cor$data <- exp_cor$data[, 1, 5:6, , 1:2, 1:3] dim(exp_cor$data) <- c(dataset = 1, member = 1, sdate = 2, ftime = 3, lat = 2, lon = 3) res <- CST_QuantileMapping(exp, obs, exp_cor, window_dim = 'ftime') +} } \seealso{ diff --git a/man/MultiMetric.Rd b/man/MultiMetric.Rd index 8a05677af54f47c1fcd2fd47eb4f583813213f39..252f735c475b17a765c26db830aebefcd8da0687 100644 --- a/man/MultiMetric.Rd +++ b/man/MultiMetric.Rd @@ -39,7 +39,7 @@ This function calculates correlation (Anomaly Correlation Coefficient; ACC), roo res <- MultiMetric(lonlat_temp$exp$data, lonlat_temp$obs$data) } \references{ -Mishra, N., Prodhomme, C., & Guemas, V. (n.d.). Multi-Model Skill Assessment of Seasonal Temperature and Precipitation Forecasts over Europe, 29-31.\url{https://link.springer.com/10.1007/s00382-018-4404-z} +Mishra, N., Prodhomme, C., & Guemas, V. (n.d.). Multi-Model Skill Assessment of Seasonal Temperature and Precipitation Forecasts over Europe, 29-31.\url{https://link.springer.com/article/10.1007/s00382-018-4404-z} } \seealso{ \code{\link[s2dv]{Corr}}, \code{\link[s2dv]{RMS}}, \code{\link[s2dv]{RMSSS}} and \code{\link{CST_Load}} diff --git a/man/PlotCombinedMap.Rd b/man/PlotCombinedMap.Rd index bbd2787aabce7d708458b4f14313e458c15561c1..cf08c8f623698f1c545d53f91c7727cde937cd46 100644 --- a/man/PlotCombinedMap.Rd +++ b/man/PlotCombinedMap.Rd @@ -21,7 +21,6 @@ PlotCombinedMap( legend_scale = 1, cex_bar_titles = 1.5, plot_margin = NULL, - bar_margin = rep(0, 4), fileout = NULL, width = 8, height = 5, @@ -67,6 +66,11 @@ layers via the parameter 'dot_symbol'.} \item{cex_bar_titles}{Scale factor for the sizes of the bar titles. Takes 1.5 by default.} +\item{plot_margin}{Numeric vector of length 4 for the margin sizes in the +following order: bottom, left, top, and right. If not specified, use the +default of par("mar"), c(5.1, 4.1, 4.1, 2.1). Used as 'margin_scale' in +s2dv::PlotEquiMap.} + \item{fileout}{File where to save the plot. If not specified (default) a graphics device will pop up. Extensions allowed: eps/ps, jpeg, png, pdf, bmp and tiff} \item{width}{File width, in the units specified in the parameter size_units (inches by default). Takes 8 by default.} diff --git a/man/QuantileMapping.Rd b/man/QuantileMapping.Rd index c2db3327a7c3ad6449bf359e3d104076921826ed..c251f33bff4f824a25d1a5457c2f5cef4534be61 100644 --- a/man/QuantileMapping.Rd +++ b/man/QuantileMapping.Rd @@ -65,15 +65,16 @@ applied to the experiment itself or to a provided forecast. } \examples{ # Use synthetic data -exp <- 1 : c(1 * 10 * 20 * 60 * 6 * 7) -dim(exp) <- c(dataset = 1, member = 10, sdate = 20, ftime = 60 , - lat = 6, lon = 7) -class(exp) <- 's2dv_cube' -obs <- 101 : c(100 + 1 * 1 * 20 * 60 * 6 * 7) -dim(obs) <- c(dataset = 1, member = 1, sdate = 20, ftime = 60 , - lat = 6, lon = 7) +exp <- 1 : c(1 * 3 * 5 * 4 * 3 * 2) +dim(exp) <- c(dataset = 1, member = 3, sdate = 5, ftime = 4, + lat = 3, lon = 2) +obs <- 101 : c(100 + 1 * 1 * 5 * 4 * 3 * 2) +dim(obs) <- c(dataset = 1, member = 1, sdate = 5, ftime = 4, + lat = 3, lon = 2) res <- QuantileMapping(exp, obs) + # Use data in package +\donttest{ exp <- lonlat_temp$exp$data[, , 1:4, , 1:2, 1:3] dim(exp) <- c(dataset = 1, member = 15, sdate = 4, ftime = 3, lat = 2, lon = 3) @@ -84,6 +85,7 @@ exp_cor <- lonlat_temp$exp$data[, 1, 5:6, , 1:2, 1:3] dim(exp_cor) <- c(dataset = 1, member = 1, sdate = 2, ftime = 3, lat = 2, lon = 3) res <- QuantileMapping(exp, obs, exp_cor, window_dim = 'ftime') +} } \seealso{ diff --git a/vignettes/MultiModelSkill_vignette.Rmd b/vignettes/MultiModelSkill_vignette.Rmd index 79d658563ef611eb89f112392ba36673a1b56c9a..fb66f94ff09199834a87e6b7d6c5d28a658e5015 100644 --- a/vignettes/MultiModelSkill_vignette.Rmd +++ b/vignettes/MultiModelSkill_vignette.Rmd @@ -11,7 +11,7 @@ vignette: > Multi-model Skill Assessment ----------------------------------------- -**reference**: Mishra, N., Prodhomme, C., & Guemas, V. (2018). Multi-Model Skill Assessment of Seasonal Temperature and Precipitation Forecasts over Europe, 29-31. +**reference**: Mishra, N., Prodhomme, C., & Guemas, V. (2018). Multi-Model Skill Assessment of Seasonal Temperature and Precipitation Forecasts over Europe, 29-31. The R package s2dv should be loaded by running: diff --git a/vignettes/WeatherRegimes_vignette.Rmd b/vignettes/WeatherRegimes_vignette.Rmd index e9bd8a7932dce19e25734bab9e32fd4bd2bfb89a..47d095ce6d424a07a9ce8ee627b1e245d9366eef 100644 --- a/vignettes/WeatherRegimes_vignette.Rmd +++ b/vignettes/WeatherRegimes_vignette.Rmd @@ -75,7 +75,7 @@ The LOESS filter has been applied to the climatology to remove the short-term va ### 4- Weather regimes in observations -`CST_WeatherRegimes()` function is used to define the clusters based on the sea level pressure anomalies from ERA-Interim. This function is based on the [*kmeans function*] (http://stat.ethz.ch/R-manual/R-devel/library/stats/html/kmeans.html) +`CST_WeatherRegimes()` function is used to define the clusters based on the sea level pressure anomalies from ERA-Interim. This function is based on the [*kmeans function*] (https://stat.ethz.ch/R-manual/R-devel/library/stats/html/kmeans.html) from the stats R package. In this example we have made different assumptions: four clusters (`ncenters=4`) will be produced and the Empirical orthogonal functions are not used to filter the data (`EOFS=FALSE`) just to take into account the extreme values. More details about the methodology can be found in Cortesi et al. 2018 (submitted).