From e99cfac8ef816b51092fb843cac8e73a1c306561 Mon Sep 17 00:00:00 2001 From: orichters Date: Thu, 14 Mar 2024 11:06:09 +0100 Subject: [PATCH] fix unit bug in plotPercentiles --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- R/plotPercentiles.R | 4 ++++ README.md | 6 +++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index a43b857..6508014 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '29444544' +ValidationKey: '29476244' 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 f63647d..a619ebb 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.8 -date-released: '2024-03-06' +version: 0.148.9 +date-released: '2024-03-14' abstract: Package contains generic functions to produce comparison plots of multi-model runs. authors: diff --git a/DESCRIPTION b/DESCRIPTION index 3a946cc..3f6e3ae 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mip Title: Comparison of multi-model runs -Version: 0.148.8 -Date: 2024-03-06 +Version: 0.148.9 +Date: 2024-03-14 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/plotPercentiles.R b/R/plotPercentiles.R index a42c899..63f4d07 100644 --- a/R/plotPercentiles.R +++ b/R/plotPercentiles.R @@ -83,6 +83,10 @@ plotPercentiles <- function(df, scenarios = NULL, variables = NULL) { theseVariables <- uniqueVariables } + data <- data %>% + filter(.data$scenario %in% theseScenarios, .data$variable %in% theseVariables) %>% + droplevels() + # Set up the plot p <- ggplot() diff --git a/README.md b/README.md index 65a8c9d..a7d7282 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Comparison of multi-model runs -R package **mip**, version **0.148.8** +R package **mip**, version **0.148.9** [![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 . +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 (URL: https://doi.org/10.5281/zenodo.1158586), R package version 0.148.9, . 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 and Tonn Rüter}, year = {2024}, - note = {R package version 0.148.8}, + note = {R package version 0.148.9}, doi = {10.5281/zenodo.1158586}, url = {https://github.com/pik-piam/mip}, }