Skip to content

Commit

Permalink
change param from 'histModels' to 'histModelsExclude' in showLinePlots
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Aug 1, 2024
1 parent 0d047dd commit 7e389b5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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", , "[email protected]", role = c("aut", "cre")),
person("Jan Philipp", "Dietrich", , "[email protected]", role = "aut"),
Expand Down
12 changes: 6 additions & 6 deletions R/showLinePlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) %>%
Expand All @@ -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)
Expand All @@ -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 %>%
Expand Down
6 changes: 3 additions & 3 deletions man/showLinePlots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7e389b5

Please sign in to comment.