Skip to content

Commit

Permalink
Merge pull request pik-piam#50 from orichters/smallfix
Browse files Browse the repository at this point in the history
fix showAreaAndBarPlot bug if only one single item is supplied
  • Loading branch information
orichters authored Dec 7, 2022
2 parents 7e2d11a + 4c1c16e commit 7f072e2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '27063400'
ValidationKey: '27084132'
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 .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "mip: Comparison of multi-model runs",
"version": "0.140.0",
"version": "0.140.1",
"description": "<p>Package contains generic functions to produce comparison\n plots of multi-model runs.<\/p>",
"creators": [
{
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.140.0
Date: 2022-12-05
Version: 0.140.1
Date: 2022-12-06
Authors@R: c(
person("David", "Klein", , "[email protected]", role = c("aut", "cre")),
person("Jan Philipp", "Dietrich", , "[email protected]", role = "aut"),
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
.PHONY: help build check test lint format
.DEFAULT_GOAL = help

# extracts the help text and formats it nicely
HELP_PARSING = 'm <- readLines("Makefile");\
m <- grep("\#\#", m, value=TRUE);\
command <- sub("^([^ ]*) *\#\#(.*)", "\\1", m);\
help <- sub("^([^ ]*) *\#\#(.*)", "\\2", m);\
cat(sprintf("%-8s%s", command, help), sep="\n")'

help: ## Show this help.
@sed -e '/##/ !d' -e '/sed/ d' -e 's/^\([^ ]*\) *##\(.*\)/\1^\2/' \
$(MAKEFILE_LIST) | column -ts '^'
@Rscript -e $(HELP_PARSING)

build: ## Build the package using lucode2::buildLibrary()
Rscript -e 'lucode2::buildLibrary()'
Expand Down
3 changes: 2 additions & 1 deletion R/showAreaAndBarPlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ showAreaAndBarPlots <- function(
p4 <- d %>%
filter(.data$region != .env$mainReg) %>%
droplevels() %>%
mipArea(scales = scales, total = is.null(tot)) +
mipArea(scales = scales, total = is.null(tot),
stack_priority = if (is.null(tot)) c("variable", "region") else "variable") +
guides(fill = guide_legend(reverse = TRUE))

# Add black lines in area plots from variable tot if provided.
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.140.0**
R package **mip**, version **0.140.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/ui#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 (2022). _mip: Comparison of multi-model runs_. doi:10.5281/zenodo.1158586 <https://doi.org/10.5281/zenodo.1158586>, R package version 0.140.0, <https://github.com/pik-piam/mip>.
Klein D, Dietrich J, Baumstark L, Humpenoeder F, Stevanovic M, Wirth S, Führlich P (2022). _mip: Comparison of multi-model runs_. doi: 10.5281/zenodo.1158586 (URL: https://doi.org/10.5281/zenodo.1158586), R package version 0.140.1, <URL: 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},
year = {2022},
note = {R package version 0.140.0},
note = {R package version 0.140.1},
doi = {10.5281/zenodo.1158586},
url = {https://github.com/pik-piam/mip},
}
Expand Down

0 comments on commit 7f072e2

Please sign in to comment.