diff --git a/.buildlibrary b/.buildlibrary index f10d853..f1526ad 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '294572082' +ValidationKey: '294903180' 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 b18b44f..5eeb6cd 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,8 +2,8 @@ cff-version: 1.2.0 message: If you use this software, please cite it using the metadata from this file. type: software title: 'mip: Comparison of multi-model runs' -version: 0.148.19 -date-released: '2024-06-04' +version: 0.148.20 +date-released: '2024-06-25' abstract: Package contains generic functions to produce comparison plots of multi-model runs. authors: diff --git a/DESCRIPTION b/DESCRIPTION index 656a528..b2e0869 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mip Title: Comparison of multi-model runs -Version: 0.148.19 -Date: 2024-06-04 +Version: 0.148.20 +Date: 2024-06-25 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/mipLineHistorical.R b/R/mipLineHistorical.R index dbc93df..c4cb6e7 100644 --- a/R/mipLineHistorical.R +++ b/R/mipLineHistorical.R @@ -166,7 +166,7 @@ mipLineHistorical <- function(x,x_hist=NULL,color.dim="identifier",linetype.dim= return(p) } - # plot the data accordig to plotting priority + # plot the data according to plotting priority plot.priority <- rev(plot.priority) for(i in 1:length(plot.priority)){ if(plot.priority[i] == "x_hist" & i>1 ){ ## if the historic values are plotted on top of the scenario ones, they should be smaller diff --git a/R/showLinePlots.R b/R/showLinePlots.R index 3febbe1..61f361d 100644 --- a/R/showLinePlots.R +++ b/R/showLinePlots.R @@ -10,6 +10,7 @@ #' to be plotted. If \code{NULL} all rows from \code{data} are plotted. #' @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 color.dim.manual optional vector with manual colors replacing default colors of color.dim, default is \code{NULL}. #' @inheritParams showAreaAndBarPlots #' @return \code{NULL} is returned invisible. #' @section Example Plots: @@ -23,9 +24,11 @@ #' @export #' @importFrom rlang .data .env #' @importFrom dplyr bind_rows +#' @importFrom gridExtra arrangeGrob + showLinePlots <- function( data, vars = NULL, scales = "free_y", color.dim.name = NULL, - mainReg = getOption("mip.mainReg") + mainReg = getOption("mip.mainReg"), color.dim.manual = NULL ) { data <- as.quitte(data) %>% @@ -90,6 +93,7 @@ showLinePlots <- function( scales = scales, plot.priority = c("x_hist", "x", "x_proj"), color.dim.name = color.dim.name, + color.dim.manual = color.dim.manual, color.dim.manual.hist = color.dim.manual.hist[mainHistModels] ) } @@ -104,6 +108,7 @@ showLinePlots <- function( plot.priority = c("x_hist", "x", "x_proj"), facet.ncol = 3, color.dim.name = color.dim.name, + color.dim.manual = color.dim.manual, color.dim.manual.hist = color.dim.manual.hist[regiHistModels] ) } diff --git a/README.md b/README.md index 0632ad8..862b07f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Comparison of multi-model runs -R package **mip**, version **0.148.19** +R package **mip**, version **0.148.20** [![CRAN status](https://www.r-pkg.org/badges/version/mip)](https://cran.r-project.org/package=mip) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1158586.svg)](https://doi.org/10.5281/zenodo.1158586) [![R build status](https://github.com/pik-piam/mip/workflows/check/badge.svg)](https://github.com/pik-piam/mip/actions) [![codecov](https://codecov.io/gh/pik-piam/mip/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mip) [![r-universe](https://pik-piam.r-universe.dev/badges/mip)](https://pik-piam.r-universe.dev/builds) @@ -47,7 +47,7 @@ In case of questions / problems please contact David Klein , R package version 0.148.19, . +Klein D, Dietrich J, Baumstark L, Humpenoeder F, Stevanovic M, Wirth S, Führlich P, Richters O, Rüter T (2024). _mip: Comparison of multi-model runs_. doi:10.5281/zenodo.1158586 , R package version 0.148.20, . A BibTeX entry for LaTeX users is @@ -56,8 +56,8 @@ A BibTeX entry for LaTeX users is title = {mip: Comparison of multi-model runs}, author = {David Klein and Jan Philipp Dietrich and Lavinia Baumstark and Florian Humpenoeder and Miodrag Stevanovic and Stephen Wirth and Pascal Führlich and Oliver Richters and Tonn Rüter}, year = {2024}, - note = {R package version 0.148.19}, - url = {https://github.com/pik-piam/mip}, + note = {R package version 0.148.20}, doi = {10.5281/zenodo.1158586}, + url = {https://github.com/pik-piam/mip}, } ``` diff --git a/man/showLinePlots.Rd b/man/showLinePlots.Rd index 67db8d3..1aac35b 100644 --- a/man/showLinePlots.Rd +++ b/man/showLinePlots.Rd @@ -9,7 +9,8 @@ showLinePlots( vars = NULL, scales = "free_y", color.dim.name = NULL, - mainReg = getOption("mip.mainReg") + mainReg = getOption("mip.mainReg"), + color.dim.manual = NULL ) } \arguments{ @@ -25,6 +26,8 @@ to be plotted. If \code{NULL} all rows from \code{data} are plotted.} \item{mainReg}{A single string. The plots for this region are shown enlarged. 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}.} } \value{ \code{NULL} is returned invisible.