diff --git a/.buildlibrary b/.buildlibrary index 626bf0c..6cb9d76 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '30495760' +ValidationKey: '30520386' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index f6ea5d4..d85a316 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -23,14 +23,14 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: | - any::lucode2 - any::covr - any::madrat - any::magclass - any::citation - any::gms - any::goxygen - any::GDPuc + lucode2 + covr + madrat + magclass + citation + gms + goxygen + GDPuc # piam packages also available on CRAN (madrat, magclass, citation, # gms, goxygen, GDPuc) will usually have an outdated binary version # available; by using extra-packages we get the newest version @@ -63,6 +63,6 @@ jobs: shell: Rscript {0} run: | nonDummyTests <- setdiff(list.files("./tests/testthat/"), c("test-dummy.R", "_snaps")) - if(length(nonDummyTests) > 0) covr::codecov(quiet = FALSE) + if(length(nonDummyTests) > 0 && !lucode2:::loadBuildLibraryConfig()[["skipCoverage"]]) covr::codecov(quiet = FALSE) env: NOT_CRAN: "true" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ccf77e..7dcd45b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ exclude: '^tests/testthat/_snaps/.*$' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # frozen: v4.6.0 + rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0 hooks: - id: check-case-conflict - id: check-json @@ -15,7 +15,7 @@ repos: - id: mixed-line-ending - repo: https://github.com/lorenzwalthert/precommit - rev: bae853d82da476eee0e0a57960ee6b741a3b3fb7 # frozen: v0.4.3 + rev: 3b70240796cdccbe1474b0176560281aaded97e6 # frozen: v0.4.3.9003 hooks: - id: parsable-R - id: deps-in-desc diff --git a/CITATION.cff b/CITATION.cff index 613cc13..de28e96 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.152.0 -date-released: '2024-12-06' +version: 0.152.1 +date-released: '2024-12-09' abstract: Package contains generic functions to produce comparison plots of multi-model runs. authors: diff --git a/DESCRIPTION b/DESCRIPTION index f204e15..47b1ffd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mip Title: Comparison of multi-model runs -Version: 0.152.0 -Date: 2024-12-06 +Version: 0.152.1 +Date: 2024-12-09 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 1650670..68ce2e3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Comparison of multi-model runs -R package **mip**, version **0.152.0** +R package **mip**, version **0.152.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.152.0, . +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 , R package version 0.152.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 and Tonn Rüter}, year = {2024}, - note = {R package version 0.152.0}, + note = {R package version 0.152.1}, url = {https://github.com/pik-piam/mip}, doi = {10.5281/zenodo.1158586}, } diff --git a/man/plotstyle.add.Rd b/man/plotstyle.add.Rd index ddbfcb6..8f8af30 100644 --- a/man/plotstyle.add.Rd +++ b/man/plotstyle.add.Rd @@ -10,11 +10,13 @@ plotstyle.add( color, marker = NULL, linestyle = NULL, - replace = FALSE + replace = FALSE, + write_file = FALSE ) } \arguments{ -\item{entity}{Vector of strings with names of entities (regions, variable names, etc.)} +\item{entity}{Vector of strings with names of entities (regions, variable +names, etc.)} \item{legend}{Vector of strings with legend names of entities.} @@ -22,23 +24,37 @@ plotstyle.add( \item{marker}{optional Vector of strings with marker codes.} -\item{linestyle}{optional Vector of strings containing linestyle codes .} +\item{linestyle}{optional Vector of strings containing linestyle codes.} -\item{replace}{Logical (default FALSE) indicating whether existing data should be replaced with new data.} +\item{replace}{Logical (default \code{FALSE}) indicating whether existing data +should be replaced with new data.} + +\item{write_file}{If \code{TRUE}, the updated plot styles are write to the file +\code{plotstyles.csv} in the current working directory.} } \description{ -Adds plot styles locally to plotstyle object and returns a dataframe with all plotstyles including the added data. However, it does NOT change the "./inst/extdata/plotstyle.csv". -To add new entities to "./inst/extdata/plotstyle.csv" please open the file in your editor and add or change values by hand. -By default plotstyles of already existing entities will not be changed. Only new entities will be added. Use the \code{replace} switch to replace existing styles. -If you want to keep the legend text or the color of an already existing entity and only replace one of the two values, use the string "keep" for the value you want to keep. +Adds plot styles locally as a per-session setting and returns a dataframe +with all plot styles including the added data. +} +\details{ +By default, plot styles of already existing entities will not be changed. +Only new entities will be added. Use the \code{replace} switch to replace +existing styles. If you want to keep the legend text or the color of an +already existing entity and only replace one of the two values, use the +string \code{"keep"} for the value you want to keep. + +To change plot styles permanently, use the \code{writefile} argument to write the +updated plot styles to a \code{.csv} file, use it to update +\code{./inst/extdata/plotstyle.csv}, and build a new package version. } \examples{ -\dontrun{plotstyle.add("AFR","Africa","#000000")} -\dontrun{plotstyle.add("AFR","keep","#FFFFFF")} -\dontrun{plotstyle.add("AFR","keep","keep",marker=20,replace=TRUE)} +\dontrun{plotstyle.add("AFR", "Africa", "#000000")} +\dontrun{plotstyle.add("AFR", "keep", "#FFFFFF")} +\dontrun{plotstyle.add("AFR", "keep", "keep", marker = 20, replace = TRUE)} + } \seealso{ -\code{\link{plotstyle}} +\code{\link[=plotstyle]{plotstyle()}} } \author{ David Klein, Jan Philipp Dietrich