From 32af399e9de5b4a24f8f07767639865b73d9f8d1 Mon Sep 17 00:00:00 2001 From: Jan Dietrich Date: Thu, 29 Jun 2023 22:30:31 +0200 Subject: [PATCH] replaced shortened inv = TRUE arguments with invert = TRUE (bugfix) --- .buildlibrary | 2 +- .pre-commit-config.yaml | 2 +- CITATION.cff | 4 ++-- CRAN-RELEASE | 2 ++ DESCRIPTION | 4 ++-- Makefile | 5 +++-- R/toolISOhistorical.R | 13 +++++++------ README.md | 6 +++--- 8 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 CRAN-RELEASE diff --git a/.buildlibrary b/.buildlibrary index 4bd5acff..019a9864 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '6491169' +ValidationKey: '6525358' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9409d2b..9c3b0698 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: mixed-line-ending - repo: https://github.com/lorenzwalthert/precommit - rev: v0.3.2.9007 + rev: v0.3.2.9013 hooks: - id: parsable-R - id: deps-in-desc diff --git a/CITATION.cff b/CITATION.cff index 0a55c112..b42911ba 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: 'madrat: May All Data be Reproducible and Transparent (MADRaT) *' -version: 3.3.3 -date-released: '2023-05-16' +version: 3.3.4 +date-released: '2023-06-29' abstract: Provides a framework which should improve reproducibility and transparency in data processing. It provides functionality such as automatic meta data creation and management, rudimentary quality management, data caching, work-flow management diff --git a/CRAN-RELEASE b/CRAN-RELEASE new file mode 100644 index 00000000..2bb901dd --- /dev/null +++ b/CRAN-RELEASE @@ -0,0 +1,2 @@ +This package was submitted to CRAN on 2019-12-17. +Once it is accepted, delete this file and tag the release (commit ebf7bcc9db). diff --git a/DESCRIPTION b/DESCRIPTION index 40e61b4d..b3830942 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: madrat Title: May All Data be Reproducible and Transparent (MADRaT) * -Version: 3.3.3 -Date: 2023-05-16 +Version: 3.3.4 +Date: 2023-06-29 Authors@R: c( person("Jan Philipp", "Dietrich", , "dietrich@pik-potsdam.de", role = c("aut", "cre")), person("Lavinia", "Baumstark", , "lavinia@pik-potsdam.de", role = "aut"), diff --git a/Makefile b/Makefile index c1e0c682..38e857f3 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,9 @@ HELP_PARSING = 'm <- readLines("Makefile");\ help: ## Show this help. @Rscript -e $(HELP_PARSING) -build: ## Build the package using lucode2::buildLibrary(). - Rscript -e 'lucode2::buildLibrary()' +build: ## Build the package using lucode2::buildLibrary(). You can pass the + ## updateType with 'make build u=3' + Rscript -e 'lucode2::buildLibrary(updateType = "$(u)")' check: ## Build documentation and vignettes, run testthat tests, ## and check if code etiquette is followed using lucode2::check(). diff --git a/R/toolISOhistorical.R b/R/toolISOhistorical.R index 033840c0..3d87a3c8 100644 --- a/R/toolISOhistorical.R +++ b/R/toolISOhistorical.R @@ -207,8 +207,8 @@ toolISOhistorical <- function(m, mapping = NULL, additional_mapping = NULL, over # time span where the data need to be adjusted subTime <- getYears(z[, seq_len(which(getYears(z) == tr$fromY)), ]) # disaggregation of countries - - + + bilatMapping <- mapping # mapping needs to be made bilateral if (mainDim == 1.1) { toISO <- as.vector(outer(bilatMapping$toISO, getItems(z, dim = secdDim), paste, sep = ".")) @@ -262,7 +262,7 @@ toolISOhistorical <- function(m, mapping = NULL, additional_mapping = NULL, over weight <- mbind(weight, addMiss) } - #set any other weight values to 0 + # set any other weight values to 0 weight[is.na(weight)] <- 0 } else { @@ -367,17 +367,18 @@ toolISOhistorical <- function(m, mapping = NULL, additional_mapping = NULL, over m[getItems(mTr, dim = 1), getYears(mTr), ] <- ifelse(is.na(m[getItems(mTr, dim = 1), getYears(mTr), ]), mTr, m[getItems(mTr, dim = 1), getYears(mTr)]) if (length(addM) > 0) { - m[is.na(m)] <- 0 } + m[is.na(m)] <- 0 + } } } # delete old lines for (b in unique(mapping$fromISO)) { if (b %in% getItems(m, dim = 1.1)) { - m <- m[list(setNames(list(c(b)), getSets(m)[1])), , inv = TRUE] + m <- m[list(setNames(list(c(b)), getSets(m)[1])), , invert = TRUE] } if (b %in% getItems(m, dim = 1.2)) { - m <- m[list(setNames(list(c(b)), getSets(m)[2])), , inv = TRUE] + m <- m[list(setNames(list(c(b)), getSets(m)[2])), , invert = TRUE] } } diff --git a/README.md b/README.md index ccfd3a72..825c0061 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # May All Data be Reproducible and Transparent (MADRaT) * -R package **madrat**, version **3.3.3** +R package **madrat**, version **3.3.4** [![CRAN status](https://www.r-pkg.org/badges/version/madrat)](https://cran.r-project.org/package=madrat) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1115490.svg)](https://doi.org/10.5281/zenodo.1115490) [![R build status](https://github.com/pik-piam/madrat/workflows/check/badge.svg)](https://github.com/pik-piam/madrat/actions) [![codecov](https://codecov.io/gh/pik-piam/madrat/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/madrat) [![r-universe](https://pik-piam.r-universe.dev/badges/madrat)](https://pik-piam.r-universe.dev/builds) @@ -55,7 +55,7 @@ In case of questions / problems please contact Jan Philipp Dietrich , R package version 3.3.3, . +Dietrich J, Baumstark L, Wirth S, Giannousakis A, Rodrigues R, Bodirsky B, Kreidenweis U, Klein D, Führlich P (2023). _madrat: May All Data be Reproducible and Transparent (MADRaT)_. doi: 10.5281/zenodo.1115490 (URL: https://doi.org/10.5281/zenodo.1115490), R package version 3.3.4, . A BibTeX entry for LaTeX users is @@ -64,7 +64,7 @@ A BibTeX entry for LaTeX users is title = {madrat: May All Data be Reproducible and Transparent (MADRaT)}, author = {Jan Philipp Dietrich and Lavinia Baumstark and Stephen Wirth and Anastasis Giannousakis and Renato Rodrigues and Benjamin Leon Bodirsky and Ulrich Kreidenweis and David Klein and Pascal Führlich}, year = {2023}, - note = {R package version 3.3.3}, + note = {R package version 3.3.4}, doi = {10.5281/zenodo.1115490}, url = {https://github.com/pik-piam/madrat}, }