From 1d322616e7d4e25a71ce3c2db933de502ef75380 Mon Sep 17 00:00:00 2001 From: Chen Gong <> Date: Mon, 5 Feb 2024 17:32:05 +0100 Subject: [PATCH 1/5] patch for showMultiLinePlots.R, can display up to 3 rows --- R/showMultiLinePlotsByVariable.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/showMultiLinePlotsByVariable.R b/R/showMultiLinePlotsByVariable.R index 805ea95..9ea537a 100644 --- a/R/showMultiLinePlotsByVariable.R +++ b/R/showMultiLinePlotsByVariable.R @@ -96,14 +96,14 @@ showMultiLinePlotsByVariable <- function( p1 <- dMainScen %>% ggplot(aes(.data$value.x, .data$value)) + geom_line(aes(linetype = .data$scenario)) + - facet_wrap(vars(.data$variable), scales = scales) + + facet_wrap(vars(.data$variable), scales = scales, nrow = 3) + theme_minimal() + expand_limits(y = 0) + ylab(label) + xlab(xLabel) p2 <- dRegiScen %>% ggplot(aes(.data$value.x, .data$value, color = .data$region)) + geom_line(aes(linetype = .data$scenario)) + - facet_wrap(vars(.data$variable), scales = scales) + + facet_wrap(vars(.data$variable), scales = scales, nrow = 3) + theme_minimal() + scale_color_manual(values = plotstyle(regions)) + expand_limits(y = 0) + From bab40d03e9cdb132ad2fe858dbbf9b57c475d818 Mon Sep 17 00:00:00 2001 From: Chen Gong <> Date: Tue, 6 Feb 2024 16:58:21 +0100 Subject: [PATCH 2/5] add panel rows and whether to print global page as an option to showMultiLinePlots and showMultiLinePlotsByVariable.R --- R/showMultiLinePlots.R | 9 ++++++--- R/showMultiLinePlotsByVariable.R | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/R/showMultiLinePlots.R b/R/showMultiLinePlots.R index 57e6b52..051bb13 100644 --- a/R/showMultiLinePlots.R +++ b/R/showMultiLinePlots.R @@ -7,6 +7,7 @@ #' \code{variable}. The plots arranged and shown. #' #' @param vars A character vector. The variables to be plotted. +#' @param NROW_NUM An integer value. Number of rows of the panel figures #' @inheritParams showLinePlots #' @return \code{NULL} is returned invisible. #' @section Example Plots: @@ -27,6 +28,7 @@ #' @importFrom ggplot2 ylim showMultiLinePlots <- function( data, vars, scales = "free_y", + NROW_NUM = 1, mainReg = getOption("mip.mainReg") ) { @@ -62,22 +64,23 @@ showMultiLinePlots <- function( } label <- paste0("(", paste0(levels(d$unit), collapse = ","), ")") - + p1 <- dMainScen %>% ggplot(aes(.data$period, .data$value)) + geom_line(aes(linetype = .data$scenario)) + geom_point(data = dMainHist, aes(shape = .data$model)) + geom_line(data = dMainHist, aes(group = paste0(.data$model, .data$region)), alpha = 0.5) + - facet_wrap(vars(.data$variable), scales = scales) + + facet_wrap(vars(.data$variable), scales = scales, nrow = NROW_NUM) + theme_minimal() + expand_limits(y = 0) + ylab(label) + p2 <- dRegiScen %>% ggplot(aes(.data$period, .data$value, color = .data$region)) + geom_line(aes(linetype = .data$scenario)) + geom_point(data = dRegiHist, aes(shape = .data$model)) + geom_line(data = dRegiHist, aes(group = paste0(.data$model, .data$region)), alpha = 0.5) + - facet_wrap(vars(.data$variable), scales = scales) + + facet_wrap(vars(.data$variable), scales = scales, nrow = NROW_NUM) + theme_minimal() + scale_color_manual(values = plotstyle(regions)) + expand_limits(y = 0) + diff --git a/R/showMultiLinePlotsByVariable.R b/R/showMultiLinePlotsByVariable.R index 9ea537a..4827c06 100644 --- a/R/showMultiLinePlotsByVariable.R +++ b/R/showMultiLinePlotsByVariable.R @@ -13,6 +13,9 @@ #' @param showHistorical A single logical value. Should historical data be #' shown? It is not recommended to set this to \code{TRUE} as the resulting #' plot we probably be quite confusing. +#' @param showGlobal A single logical value. Should global data be +#' shown? Default is false to save space in pdf +#' @param NROW_NUM An integer value. Number of rows of the panel figures #' @param histRefModel A named character vector identifying the unique model to #' be chosen for historical data. Use \code{options(mip.histRefModel=)} #' to set globally. @@ -42,6 +45,8 @@ showMultiLinePlotsByVariable <- function( data, vars, xVar, scales = "free_y", showHistorical = FALSE, + showGlobal = FALSE, + NROW_NUM = 1, mainReg = getOption("mip.mainReg"), histRefModel = getOption("mip.histRefModel"), yearsByVariable = getOption("mip.yearsBarPlot") @@ -92,39 +97,46 @@ showMultiLinePlotsByVariable <- function( label <- paste0("(", paste0(levels(d$unit), collapse = ","), ")") xLabel <- paste0(xVar, " (", paste0(levels(d$unit.x), collapse = ","), ")") - + + if (showGlobal) { p1 <- dMainScen %>% ggplot(aes(.data$value.x, .data$value)) + geom_line(aes(linetype = .data$scenario)) + - facet_wrap(vars(.data$variable), scales = scales, nrow = 3) + + facet_wrap(vars(.data$variable), scales = scales, nrow = NROW_NUM) + theme_minimal() + expand_limits(y = 0) + ylab(label) + xlab(xLabel) + } p2 <- dRegiScen %>% ggplot(aes(.data$value.x, .data$value, color = .data$region)) + geom_line(aes(linetype = .data$scenario)) + - facet_wrap(vars(.data$variable), scales = scales, nrow = 3) + + facet_wrap(vars(.data$variable), scales = scales, nrow = NROW_NUM) + theme_minimal() + scale_color_manual(values = plotstyle(regions)) + expand_limits(y = 0) + ylab(label) + xlab(xLabel) + if (showHistorical) { stopifnot(xVar %in% names(histRefModel)) + if (showGlobal) { p1 <- p1 + geom_point(data = dMainHist, aes(shape = .data$model)) + geom_line(data = dMainHist, aes(group = paste0(.data$model, .data$region)), alpha = 0.5) + } p2 <- p2 + geom_point(data = dRegiHist, aes(shape = .data$model)) + geom_line(data = dRegiHist, aes(group = paste0(.data$model, .data$region)), alpha = 0.5) } # Add markers for certain years. if (length(yearsByVariable) > 0) { + if (showGlobal) { p1 <- p1 + geom_point( data = dMainScen %>% filter(.data$period %in% .env$yearsByVariable) %>% mutate(year = factor(.data$period)), mapping = aes(.data$value.x, .data$value, shape = .data$year)) + } p2 <- p2 + geom_point( data = dRegiScen %>% @@ -134,8 +146,10 @@ showMultiLinePlotsByVariable <- function( } # Show plots. + if (showGlobal) { print(p1) cat("\n\n") + } print(p2) cat("\n\n") From 0ac59646dca2a12fe7b8a451c46b5a868881dcb9 Mon Sep 17 00:00:00 2001 From: Chen Gong <> Date: Wed, 7 Feb 2024 13:55:27 +0100 Subject: [PATCH 3/5] version update --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- README.md | 6 +++--- man/showMultiLinePlots.Rd | 3 +++ man/showMultiLinePlotsByVariable.Rd | 7 +++++++ 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index de66603..73c502e 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '29083776' +ValidationKey: '29244800' 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 bf2a452..ce0de11 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.147.2 -date-released: '2024-02-05' +version: 0.148.0 +date-released: '2024-02-07' abstract: Package contains generic functions to produce comparison plots of multi-model runs. authors: diff --git a/DESCRIPTION b/DESCRIPTION index a08fe6c..fe6da5f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mip Title: Comparison of multi-model runs -Version: 0.147.2 -Date: 2024-02-05 +Version: 0.148.0 +Date: 2024-02-07 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/README.md b/README.md index 651f341..1aa15b4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Comparison of multi-model runs -R package **mip**, version **0.147.2** +R package **mip**, version **0.148.0** [![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.147.2, . +Klein D, Dietrich J, Baumstark L, Humpenoeder F, Stevanovic M, Wirth S, Führlich P, Richters O (2024). _mip: Comparison of multi-model runs_. doi:10.5281/zenodo.1158586 , R package version 0.148.0, . A BibTeX entry for LaTeX users is @@ -56,7 +56,7 @@ 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}, year = {2024}, - note = {R package version 0.147.2}, + note = {R package version 0.148.0}, doi = {10.5281/zenodo.1158586}, url = {https://github.com/pik-piam/mip}, } diff --git a/man/showMultiLinePlots.Rd b/man/showMultiLinePlots.Rd index 8a39f6b..da096b4 100644 --- a/man/showMultiLinePlots.Rd +++ b/man/showMultiLinePlots.Rd @@ -8,6 +8,7 @@ showMultiLinePlots( data, vars, scales = "free_y", + NROW_NUM = 1, mainReg = getOption("mip.mainReg") ) } @@ -19,6 +20,8 @@ quitte object.} \item{scales}{A single string. choose either \code{"free_y"} or \code{"fixed"}.} +\item{NROW_NUM}{An integer value. Number of rows of the panel figures} + \item{mainReg}{A single string. The plots for this region are shown enlarged. Use \code{options(mip.mainReg=)} to set globally.} } diff --git a/man/showMultiLinePlotsByVariable.Rd b/man/showMultiLinePlotsByVariable.Rd index 66d4827..7cf0f17 100644 --- a/man/showMultiLinePlotsByVariable.Rd +++ b/man/showMultiLinePlotsByVariable.Rd @@ -10,6 +10,8 @@ showMultiLinePlotsByVariable( xVar, scales = "free_y", showHistorical = FALSE, + showGlobal = FALSE, + NROW_NUM = 1, mainReg = getOption("mip.mainReg"), histRefModel = getOption("mip.histRefModel"), yearsByVariable = getOption("mip.yearsBarPlot") @@ -29,6 +31,11 @@ quitte object.} shown? It is not recommended to set this to \code{TRUE} as the resulting plot we probably be quite confusing.} +\item{showGlobal}{A single logical value. Should global data be +shown? Default is false to save space in pdf} + +\item{NROW_NUM}{An integer value. Number of rows of the panel figures} + \item{mainReg}{A single string. The plots for this region are shown enlarged. Use \code{options(mip.mainReg=)} to set globally.} From 9fbe19cba00ace0637110c7cf9a278a3711a2014 Mon Sep 17 00:00:00 2001 From: Chen Gong <> Date: Wed, 7 Feb 2024 17:06:47 +0100 Subject: [PATCH 4/5] small patches --- .buildlibrary | 2 +- CITATION.cff | 2 +- DESCRIPTION | 2 +- R/showMultiLinePlots.R | 8 ++++---- R/showMultiLinePlotsByVariable.R | 30 ++++++++++++++--------------- README.md | 6 +++--- man/showMultiLinePlots.Rd | 4 ++-- man/showMultiLinePlotsByVariable.Rd | 4 ++-- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 73c502e..057a753 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '29244800' +ValidationKey: '29264560' 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 ce0de11..d6ee92e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,7 +2,7 @@ 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.0 +version: 0.148.1 date-released: '2024-02-07' abstract: Package contains generic functions to produce comparison plots of multi-model runs. diff --git a/DESCRIPTION b/DESCRIPTION index fe6da5f..6c3a835 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: mip Title: Comparison of multi-model runs -Version: 0.148.0 +Version: 0.148.1 Date: 2024-02-07 Authors@R: c( person("David", "Klein", , "dklein@pik-potsdam.de", role = c("aut", "cre")), diff --git a/R/showMultiLinePlots.R b/R/showMultiLinePlots.R index 051bb13..fcd45c3 100644 --- a/R/showMultiLinePlots.R +++ b/R/showMultiLinePlots.R @@ -7,7 +7,7 @@ #' \code{variable}. The plots arranged and shown. #' #' @param vars A character vector. The variables to be plotted. -#' @param NROW_NUM An integer value. Number of rows of the panel figures +#' @param nrowNum An integer value. Number of rows of the panel figures #' @inheritParams showLinePlots #' @return \code{NULL} is returned invisible. #' @section Example Plots: @@ -28,7 +28,7 @@ #' @importFrom ggplot2 ylim showMultiLinePlots <- function( data, vars, scales = "free_y", - NROW_NUM = 1, + nrowNum = 1, mainReg = getOption("mip.mainReg") ) { @@ -70,7 +70,7 @@ showMultiLinePlots <- function( geom_line(aes(linetype = .data$scenario)) + geom_point(data = dMainHist, aes(shape = .data$model)) + geom_line(data = dMainHist, aes(group = paste0(.data$model, .data$region)), alpha = 0.5) + - facet_wrap(vars(.data$variable), scales = scales, nrow = NROW_NUM) + + facet_wrap(vars(.data$variable), scales = scales, nrow = nrowNum) + theme_minimal() + expand_limits(y = 0) + ylab(label) @@ -80,7 +80,7 @@ showMultiLinePlots <- function( geom_line(aes(linetype = .data$scenario)) + geom_point(data = dRegiHist, aes(shape = .data$model)) + geom_line(data = dRegiHist, aes(group = paste0(.data$model, .data$region)), alpha = 0.5) + - facet_wrap(vars(.data$variable), scales = scales, nrow = NROW_NUM) + + facet_wrap(vars(.data$variable), scales = scales, nrow = nrowNum) + theme_minimal() + scale_color_manual(values = plotstyle(regions)) + expand_limits(y = 0) + diff --git a/R/showMultiLinePlotsByVariable.R b/R/showMultiLinePlotsByVariable.R index 4827c06..9bddadc 100644 --- a/R/showMultiLinePlotsByVariable.R +++ b/R/showMultiLinePlotsByVariable.R @@ -15,7 +15,7 @@ #' plot we probably be quite confusing. #' @param showGlobal A single logical value. Should global data be #' shown? Default is false to save space in pdf -#' @param NROW_NUM An integer value. Number of rows of the panel figures +#' @param nrowNum An integer value. Number of rows of the panel figures #' @param histRefModel A named character vector identifying the unique model to #' be chosen for historical data. Use \code{options(mip.histRefModel=)} #' to set globally. @@ -46,7 +46,7 @@ showMultiLinePlotsByVariable <- function( data, vars, xVar, scales = "free_y", showHistorical = FALSE, showGlobal = FALSE, - NROW_NUM = 1, + nrowNum = 1, mainReg = getOption("mip.mainReg"), histRefModel = getOption("mip.histRefModel"), yearsByVariable = getOption("mip.yearsBarPlot") @@ -102,7 +102,7 @@ showMultiLinePlotsByVariable <- function( p1 <- dMainScen %>% ggplot(aes(.data$value.x, .data$value)) + geom_line(aes(linetype = .data$scenario)) + - facet_wrap(vars(.data$variable), scales = scales, nrow = NROW_NUM) + + facet_wrap(vars(.data$variable), scales = scales, nrow = nrowNum) + theme_minimal() + expand_limits(y = 0) + ylab(label) + xlab(xLabel) @@ -110,7 +110,7 @@ showMultiLinePlotsByVariable <- function( p2 <- dRegiScen %>% ggplot(aes(.data$value.x, .data$value, color = .data$region)) + geom_line(aes(linetype = .data$scenario)) + - facet_wrap(vars(.data$variable), scales = scales, nrow = NROW_NUM) + + facet_wrap(vars(.data$variable), scales = scales, nrow = nrowNum) + theme_minimal() + scale_color_manual(values = plotstyle(regions)) + expand_limits(y = 0) + @@ -119,9 +119,9 @@ showMultiLinePlotsByVariable <- function( if (showHistorical) { stopifnot(xVar %in% names(histRefModel)) if (showGlobal) { - p1 <- p1 + - geom_point(data = dMainHist, aes(shape = .data$model)) + - geom_line(data = dMainHist, aes(group = paste0(.data$model, .data$region)), alpha = 0.5) + p1 <- p1 + + geom_point(data = dMainHist, aes(shape = .data$model)) + + geom_line(data = dMainHist, aes(group = paste0(.data$model, .data$region)), alpha = 0.5) } p2 <- p2 + geom_point(data = dRegiHist, aes(shape = .data$model)) + @@ -130,12 +130,12 @@ showMultiLinePlotsByVariable <- function( # Add markers for certain years. if (length(yearsByVariable) > 0) { if (showGlobal) { - p1 <- p1 + - geom_point( - data = dMainScen %>% - filter(.data$period %in% .env$yearsByVariable) %>% - mutate(year = factor(.data$period)), - mapping = aes(.data$value.x, .data$value, shape = .data$year)) + p1 <- p1 + + geom_point( + data = dMainScen %>% + filter(.data$period %in% .env$yearsByVariable) %>% + mutate(year = factor(.data$period)), + mapping = aes(.data$value.x, .data$value, shape = .data$year)) } p2 <- p2 + geom_point( @@ -147,8 +147,8 @@ showMultiLinePlotsByVariable <- function( # Show plots. if (showGlobal) { - print(p1) - cat("\n\n") + print(p1) + cat("\n\n") } print(p2) cat("\n\n") diff --git a/README.md b/README.md index 1aa15b4..e27e667 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Comparison of multi-model runs -R package **mip**, version **0.148.0** +R package **mip**, version **0.148.1** [![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.0, . +Klein D, Dietrich J, Baumstark L, Humpenoeder F, Stevanovic M, Wirth S, Führlich P, Richters O (2024). _mip: Comparison of multi-model runs_. doi:10.5281/zenodo.1158586 , R package version 0.148.1, . A BibTeX entry for LaTeX users is @@ -56,7 +56,7 @@ 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}, year = {2024}, - note = {R package version 0.148.0}, + note = {R package version 0.148.1}, doi = {10.5281/zenodo.1158586}, url = {https://github.com/pik-piam/mip}, } diff --git a/man/showMultiLinePlots.Rd b/man/showMultiLinePlots.Rd index da096b4..bb4f68c 100644 --- a/man/showMultiLinePlots.Rd +++ b/man/showMultiLinePlots.Rd @@ -8,7 +8,7 @@ showMultiLinePlots( data, vars, scales = "free_y", - NROW_NUM = 1, + nrowNum = 1, mainReg = getOption("mip.mainReg") ) } @@ -20,7 +20,7 @@ quitte object.} \item{scales}{A single string. choose either \code{"free_y"} or \code{"fixed"}.} -\item{NROW_NUM}{An integer value. Number of rows of the panel figures} +\item{nrowNum}{An integer value. Number of rows of the panel figures} \item{mainReg}{A single string. The plots for this region are shown enlarged. Use \code{options(mip.mainReg=)} to set globally.} diff --git a/man/showMultiLinePlotsByVariable.Rd b/man/showMultiLinePlotsByVariable.Rd index 7cf0f17..2d3a04a 100644 --- a/man/showMultiLinePlotsByVariable.Rd +++ b/man/showMultiLinePlotsByVariable.Rd @@ -11,7 +11,7 @@ showMultiLinePlotsByVariable( scales = "free_y", showHistorical = FALSE, showGlobal = FALSE, - NROW_NUM = 1, + nrowNum = 1, mainReg = getOption("mip.mainReg"), histRefModel = getOption("mip.histRefModel"), yearsByVariable = getOption("mip.yearsBarPlot") @@ -34,7 +34,7 @@ plot we probably be quite confusing.} \item{showGlobal}{A single logical value. Should global data be shown? Default is false to save space in pdf} -\item{NROW_NUM}{An integer value. Number of rows of the panel figures} +\item{nrowNum}{An integer value. Number of rows of the panel figures} \item{mainReg}{A single string. The plots for this region are shown enlarged. Use \code{options(mip.mainReg=)} to set globally.} From 8fa041820b6602e41d12ea91cde9c4a69b918f47 Mon Sep 17 00:00:00 2001 From: Chen Gong <> Date: Wed, 7 Feb 2024 17:11:33 +0100 Subject: [PATCH 5/5] small patches --- .buildlibrary | 2 +- CITATION.cff | 2 +- DESCRIPTION | 2 +- R/showMultiLinePlotsByVariable.R | 14 +++++++------- README.md | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 057a753..be92351 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '29264560' +ValidationKey: '29284320' 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 d6ee92e..3e241d0 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,7 +2,7 @@ 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.1 +version: 0.148.2 date-released: '2024-02-07' abstract: Package contains generic functions to produce comparison plots of multi-model runs. diff --git a/DESCRIPTION b/DESCRIPTION index 6c3a835..1bfe8df 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: mip Title: Comparison of multi-model runs -Version: 0.148.1 +Version: 0.148.2 Date: 2024-02-07 Authors@R: c( person("David", "Klein", , "dklein@pik-potsdam.de", role = c("aut", "cre")), diff --git a/R/showMultiLinePlotsByVariable.R b/R/showMultiLinePlotsByVariable.R index 9bddadc..09b3b1e 100644 --- a/R/showMultiLinePlotsByVariable.R +++ b/R/showMultiLinePlotsByVariable.R @@ -99,13 +99,13 @@ showMultiLinePlotsByVariable <- function( xLabel <- paste0(xVar, " (", paste0(levels(d$unit.x), collapse = ","), ")") if (showGlobal) { - p1 <- dMainScen %>% - ggplot(aes(.data$value.x, .data$value)) + - geom_line(aes(linetype = .data$scenario)) + - facet_wrap(vars(.data$variable), scales = scales, nrow = nrowNum) + - theme_minimal() + - expand_limits(y = 0) + - ylab(label) + xlab(xLabel) + p1 <- dMainScen %>% + ggplot(aes(.data$value.x, .data$value)) + + geom_line(aes(linetype = .data$scenario)) + + facet_wrap(vars(.data$variable), scales = scales, nrow = nrowNum) + + theme_minimal() + + expand_limits(y = 0) + + ylab(label) + xlab(xLabel) } p2 <- dRegiScen %>% ggplot(aes(.data$value.x, .data$value, color = .data$region)) + diff --git a/README.md b/README.md index e27e667..4fbf176 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Comparison of multi-model runs -R package **mip**, version **0.148.1** +R package **mip**, version **0.148.2** [![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.1, . +Klein D, Dietrich J, Baumstark L, Humpenoeder F, Stevanovic M, Wirth S, Führlich P, Richters O (2024). _mip: Comparison of multi-model runs_. doi:10.5281/zenodo.1158586 , R package version 0.148.2, . A BibTeX entry for LaTeX users is @@ -56,7 +56,7 @@ 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}, year = {2024}, - note = {R package version 0.148.1}, + note = {R package version 0.148.2}, doi = {10.5281/zenodo.1158586}, url = {https://github.com/pik-piam/mip}, }