Skip to content

Commit

Permalink
Merge pull request #105 from FelicitasBeier/master
Browse files Browse the repository at this point in the history
Handing over color.dim.manual argument in showLinePlots
  • Loading branch information
FelicitasBeier authored Jun 26, 2024
2 parents 68795ce + a357513 commit 014a5ae
Show file tree
Hide file tree
Showing 7 changed files with 20 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: '294572082'
ValidationKey: '294903180'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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", , "[email protected]", role = c("aut", "cre")),
person("Jan Philipp", "Dietrich", , "[email protected]", role = "aut"),
Expand Down
2 changes: 1 addition & 1 deletion R/mipLineHistorical.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion R/showLinePlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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) %>%
Expand Down Expand Up @@ -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]
)
}
Expand All @@ -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]
)
}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -47,7 +47,7 @@ In case of questions / problems please contact David Klein <[email protected]

To cite package **mip** in publications use:

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 <https://doi.org/10.5281/zenodo.1158586>, R package version 0.148.19, <https://github.com/pik-piam/mip>.
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 <https://doi.org/10.5281/zenodo.1158586>, R package version 0.148.20, <https://github.com/pik-piam/mip>.

A BibTeX entry for LaTeX users is

Expand All @@ -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},
}
```
5 changes: 4 additions & 1 deletion man/showLinePlots.Rd

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

0 comments on commit 014a5ae

Please sign in to comment.