Skip to content

Commit

Permalink
Merge pull request #77 from fbenke-pik/master
Browse files Browse the repository at this point in the history
add scale option to iteration plots
  • Loading branch information
fbenke-pik authored Aug 10, 2023
2 parents b3dbab6 + 275f982 commit d77164e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '28427256'
ValidationKey: '28448287'
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.145.2
date-released: '2023-08-09'
version: 0.145.3
date-released: '2023-08-10'
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.145.2
Date: 2023-08-09
Version: 0.145.3
Date: 2023-08-10
Authors@R: c(
person("David", "Klein", , "[email protected]", role = c("aut", "cre")),
person("Jan Philipp", "Dietrich", , "[email protected]", role = "aut"),
Expand Down
7 changes: 5 additions & 2 deletions R/mipIterations.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#' plotly. If NULL no slider is used.
#' @param facets A string from names(x), defining which column is used for grouping. A small plot (facet) is
#' shown for each group. If NULL facets are not used.
#' @param facetScales The 'scales' argument for facets (if used), defaults to 'fixed'. See help(facet_wrap) for more info.
#'
#' @return A list of plotly plots, if returnGgplots is TRUE a list of ggplots instead
#' @author Pascal Führlich
#' @seealso \code{\link{getPlotData}}
Expand All @@ -27,7 +29,8 @@
#' @importFrom utils tail
#' @export
mipIterations <- function(plotData, returnGgplots = FALSE,
xAxis = "year", color = NULL, slider = "iteration", facets = "region") {
xAxis = "year", color = NULL, slider = "iteration", facets = "region",
facetScales = "fixed") {
nonNullArgs <- Filter(Negate(is.null), c(xAxis, color, slider, facets))
if (any(!(nonNullArgs %in% c(names(plotData), "year", "region")))) {
stop(
Expand Down Expand Up @@ -115,7 +118,7 @@ mipIterations <- function(plotData, returnGgplots = FALSE,
theme(strip.background = element_blank())
if (!is.null(facets)) {
# by default create a small plot for each region; always show all facets, even if empty
plot <- plot + facet_wrap(facets, drop = FALSE)
plot <- plot + facet_wrap(facets, drop = FALSE, scales = facetScales)
}
if (!is.null(color) && is.numeric(plotData[[color]])) {
plot <- plot + scale_color_gradientn(colours = rainbow(5, v = 0.8))
Expand Down
6 changes: 3 additions & 3 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.145.2**
R package **mip**, version **0.145.3**

[![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 (2023). _mip: Comparison of multi-model runs_. doi:10.5281/zenodo.1158586 <https://doi.org/10.5281/zenodo.1158586>, R package version 0.145.2, <https://github.com/pik-piam/mip>.
Klein D, Dietrich J, Baumstark L, Humpenoeder F, Stevanovic M, Wirth S, Führlich P, Richters O (2023). _mip: Comparison of multi-model runs_. doi:10.5281/zenodo.1158586 <https://doi.org/10.5281/zenodo.1158586>, R package version 0.145.3, <https://github.com/pik-piam/mip>.

A BibTeX entry for LaTeX users is

Expand All @@ -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 = {2023},
note = {R package version 0.145.2},
note = {R package version 0.145.3},
doi = {10.5281/zenodo.1158586},
url = {https://github.com/pik-piam/mip},
}
Expand Down
5 changes: 4 additions & 1 deletion man/mipIterations.Rd

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

0 comments on commit d77164e

Please sign in to comment.