From f26df67bd72cce7f081f20ce34e0983630333023 Mon Sep 17 00:00:00 2001 From: Falk Benke Date: Tue, 16 Apr 2024 14:16:45 +0200 Subject: [PATCH 1/2] make preprocessing an R script --- inst/compareScenarios/cs_main.Rmd | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/inst/compareScenarios/cs_main.Rmd b/inst/compareScenarios/cs_main.Rmd index 0b5342a..3300b37 100644 --- a/inst/compareScenarios/cs_main.Rmd +++ b/inst/compareScenarios/cs_main.Rmd @@ -196,6 +196,7 @@ dataHist <- dataScen <- dataScen %>% filter(period %in% params$yearsScen) + dataHist <- dataHist %>% filter(period %in% params$yearsHist, !(model %in% params$modelsHistExclude), !is.na(value)) %>% @@ -223,10 +224,6 @@ if (!is.null(params$reg)) { } ``` -```{r quitte} -data <- as.quitte(data) -``` - ```{r global variables} on.exit(options(warn = getOption("warn"))) @@ -273,11 +270,17 @@ if (length(params$sections) == 1 && params$sections == "all") { } } -preprocessingFilePath <- if (file.exists("preprocessing.Rmd")) "preprocessing.Rmd" else character(0) +``` + +```{r include preprocessing} +if (file.exists("preprocessing.R")) { + source("preprocessing.R", local = TRUE) +} ``` -```{r include preprocessing, child = preprocessingFilePath} +```{r quitte} +data <- as.quitte(data) ``` ```{r remove objects not to be used anymore} From a6c55fa5d26b7d3b5bdb4e967da092891d52ab0a Mon Sep 17 00:00:00 2001 From: Falk Benke Date: Tue, 16 Apr 2024 19:24:35 +0200 Subject: [PATCH 2/2] increment version --- .buildlibrary | 2 +- .github/workflows/check.yaml | 1 - CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- README.md | 6 +++--- inst/compareScenarios/cs_main.Rmd | 1 + 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index d9d5ecb..3185ea4 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '79272' +ValidationKey: '99145' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 0d812d9..f6ea5d4 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -23,7 +23,6 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: extra-packages: | - gamstransfer=?ignore any::lucode2 any::covr any::madrat diff --git a/CITATION.cff b/CITATION.cff index 42fb77f..86d7991 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: 'piamPlotComparison: Create comparison plots for your model results' -version: 0.0.4 -date-released: '2024-04-05' +version: 0.0.5 +date-released: '2024-04-16' abstract: A frameworks to create comparison plots for your model results. authors: - family-names: Benke diff --git a/DESCRIPTION b/DESCRIPTION index 0e91203..ff3fe72 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: piamPlotComparison Title: Create comparison plots for your model results -Version: 0.0.4 -Date: 2024-04-05 +Version: 0.0.5 +Date: 2024-04-16 Authors@R: c( person("Falk", "Benke", , "benke@pik-potsdam.de", role = c("aut", "cre")), person("Christof", "Schoetz", role = "aut") diff --git a/README.md b/README.md index 911e4a7..43e7681 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Create comparison plots for your model results -R package **piamPlotComparison**, version **0.0.4** +R package **piamPlotComparison**, version **0.0.5** [![CRAN status](https://www.r-pkg.org/badges/version/piamPlotComparison)](https://cran.r-project.org/package=piamPlotComparison) [![R build status](https://github.com/pik-piam/piamPlotComparison/workflows/check/badge.svg)](https://github.com/pik-piam/piamPlotComparison/actions) [![codecov](https://codecov.io/gh/pik-piam/piamPlotComparison/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/piamPlotComparison) [![r-universe](https://pik-piam.r-universe.dev/badges/piamPlotComparison)](https://pik-piam.r-universe.dev/builds) @@ -46,7 +46,7 @@ In case of questions / problems please contact Falk Benke To cite package **piamPlotComparison** in publications use: -Benke F, Schoetz C (2024). _piamPlotComparison: Create comparison plots for your model results_. R package version 0.0.4, . +Benke F, Schoetz C (2024). _piamPlotComparison: Create comparison plots for your model results_. R package version 0.0.5, . A BibTeX entry for LaTeX users is @@ -55,7 +55,7 @@ A BibTeX entry for LaTeX users is title = {piamPlotComparison: Create comparison plots for your model results}, author = {Falk Benke and Christof Schoetz}, year = {2024}, - note = {R package version 0.0.4}, + note = {R package version 0.0.5}, url = {https://github.com/pik-piam/piamPlotComparison}, } ``` diff --git a/inst/compareScenarios/cs_main.Rmd b/inst/compareScenarios/cs_main.Rmd index 3300b37..72e46f9 100644 --- a/inst/compareScenarios/cs_main.Rmd +++ b/inst/compareScenarios/cs_main.Rmd @@ -83,6 +83,7 @@ if (interactive()) { # may cause "Undefined control sequence" errors in LaTeX. try(unloadNamespace("kableExtra"), silent = TRUE) +library(piamPlotComparison) suppressMessages(library(gridExtra)) options(tidyverse.quiet = TRUE) library(tidyverse)