diff --git a/.buildlibrary b/.buildlibrary index c1d05d5..e7ccef3 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '29741528' +ValidationKey: '29744512' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/CITATION.cff b/CITATION.cff index deb4c9e..9d8d7b9 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -3,7 +3,7 @@ message: If you use this software, please cite it using the metadata from this f type: software title: 'mip: Comparison of multi-model runs' version: 0.149.2 -date-released: '2024-07-30' +date-released: '2024-08-01' abstract: Package contains generic functions to produce comparison plots of multi-model runs. authors: diff --git a/DESCRIPTION b/DESCRIPTION index 3bdc8ea..522af62 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Type: Package Package: mip Title: Comparison of multi-model runs Version: 0.149.2 -Date: 2024-07-30 +Date: 2024-08-01 Authors@R: c( person("David", "Klein", , "dklein@pik-potsdam.de", role = c("aut", "cre")), person("Jan Philipp", "Dietrich", , "dietrich@pik-potsdam.de", role = "aut"), diff --git a/R/showLinePlots.R b/R/showLinePlots.R index 0cfc5f3..307b7e0 100644 --- a/R/showLinePlots.R +++ b/R/showLinePlots.R @@ -12,8 +12,8 @@ #' to be plotted. If \code{NULL}, it is set to \code{vars}. #' @param scales A single string. choose either \code{"free_y"} or \code{"fixed"}. #' @param color.dim.name name for the color-dimension used in the legend -#' @param histModels A character vector filtering the historical models to include. -#' Set to \code{NULL} (default) for no filtering. +#' @param histModelsExclude A character vector with historical models to exclude. +#' Set to \code{NULL} (default) for all available data. #' @param color.dim.manual optional vector with manual colors replacing default #' colors of color.dim, default is \code{NULL}. #' @inheritParams showAreaAndBarPlots @@ -39,7 +39,7 @@ showLinePlots <- function( color.dim.name = NULL, mainReg = getOption("mip.mainReg"), color.dim.manual = NULL, - histModels = NULL + histModelsExclude = NULL ) { data <- as.quitte(data) %>% @@ -48,7 +48,7 @@ showLinePlots <- function( # Validate function arguments. stopifnot(is.character(vars) || is.null(vars)) stopifnot(is.character(histVars) || is.null(histVars)) - stopifnot(is.character(histModels) || is.null(histModels)) + stopifnot(is.character(histModelsExclude) || is.null(histModelsExclude)) stopifnot(is.character(scales) && length(scales) == 1) checkGlobalOptionsProvided("mainReg") stopifnot(is.character(mainReg) && length(mainReg) == 1) @@ -71,9 +71,9 @@ showLinePlots <- function( label <- paste0(paste0(levels(d$variable), collapse = ","), unitlabel) } - if (!is.null(histModels)) { + if (!is.null(histModelsExclude)) { d <- d %>% - filter(.data$scenario != "historical" | .data$model %in% .env$histModels) + filter(.data$scenario != "historical" | !.data$model %in% .env$histModelsExclude) } dMainScen <- d %>% diff --git a/man/showLinePlots.Rd b/man/showLinePlots.Rd index 8b32646..62b3f3f 100644 --- a/man/showLinePlots.Rd +++ b/man/showLinePlots.Rd @@ -12,7 +12,7 @@ showLinePlots( color.dim.name = NULL, mainReg = getOption("mip.mainReg"), color.dim.manual = NULL, - histModels = NULL + histModelsExclude = NULL ) } \arguments{ @@ -35,8 +35,8 @@ Use \code{options(mip.mainReg=)} to set globally.} \item{color.dim.manual}{optional vector with manual colors replacing default colors of color.dim, default is \code{NULL}.} -\item{histModels}{A character vector filtering the historical models to include. -Set to \code{NULL} (default) for no filtering.} +\item{histModelsExclude}{A character vector with historical models to exclude. +Set to \code{NULL} (default) for all available data.} } \value{ \code{NULL} is returned invisible.