From 051e1739805e4a964af214d32cddd1e93a8b53e8 Mon Sep 17 00:00:00 2001 From: Baseer Ahmad Baheer Date: Thu, 13 Jul 2023 02:12:11 +0200 Subject: [PATCH] Adjusted the where value in toolGetMapping() --- .buildlibrary | 2 +- .pre-commit-config.yaml | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- Makefile | 5 +++-- R/calcUrbanFuture.R | 2 +- R/toolGetEUcountries.R | 2 +- README.md | 6 +++--- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 9c6dcd3..17b19cb 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '2341080' +ValidationKey: '2365671' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9409d2..9c3b069 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 6a24fc3..87b242d 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: 'mrdrivers: Create GDP and Population Scenarios' -version: 1.2.0 -date-released: '2023-06-01' +version: 1.2.1 +date-released: '2023-07-13' abstract: Create GDP and population scenarios This package constructs the GDP and population scenarios used as drivers in both the REMIND and MAgPIE models. authors: diff --git a/DESCRIPTION b/DESCRIPTION index 6c45e24..ee2eed4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: mrdrivers Type: Package Title: Create GDP and Population Scenarios -Version: 1.2.0 +Version: 1.2.1 Authors@R: c(person(given = "Johannes", family = "Koch", email = "jokoch@pik-potsdam.de", @@ -49,6 +49,6 @@ Suggests: Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.2.3 -Date: 2023-06-01 +Date: 2023-07-13 Config/testthat/edition: 3 VignetteBuilder: knitr diff --git a/Makefile b/Makefile index c1e0c68..38e857f 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/calcUrbanFuture.R b/R/calcUrbanFuture.R index 479fc01..2b35773 100644 --- a/R/calcUrbanFuture.R +++ b/R/calcUrbanFuture.R @@ -75,7 +75,7 @@ mapSHAPEurban <- function(ssp, sdp, sspUrb) { if (grepl("|", ssp, fixed = TRUE)) { # distinguish between OECD and non-OECD ssp <- strsplit(ssp, split = "\\|")[[1]] - oecdMapping <- toolGetMapping("regionmappingOECD.csv", type = "regional") + oecdMapping <- toolGetMapping("regionmappingOECD.csv", type = "regional", where = "mappingfolder") oecd <- oecdMapping[oecdMapping$RegionCode == "OECD", "CountryCode"] nonOECD <- oecdMapping[oecdMapping$RegionCode == "Non-OECD", "CountryCode"] mbind(setNames(sspUrb[oecd, , ssp[1]], sdp), diff --git a/R/toolGetEUcountries.R b/R/toolGetEUcountries.R index 54080a8..46f40f0 100644 --- a/R/toolGetEUcountries.R +++ b/R/toolGetEUcountries.R @@ -1,7 +1,7 @@ # These countries are the ones (essentiall the EU-27) that receive special treatment # in the SSP2EU scenario. toolGetEUcountries <- function(onlyWithARIADNEgdpData = FALSE) { - x <- toolGetMapping("regionmappingH12.csv") %>% + x <- toolGetMapping("regionmappingH12.csv", where = "mappingfolder") %>% tibble::as_tibble() %>% dplyr::filter(.data$RegionCode == "EUR", .data$CountryCode != "GBR") %>% dplyr::pull(.data$CountryCode) diff --git a/README.md b/README.md index 5305312..6d9f383 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Create GDP and Population Scenarios -R package **mrdrivers**, version **1.2.0** +R package **mrdrivers**, version **1.2.1** [![CRAN status](https://www.r-pkg.org/badges/version/mrdrivers)](https://cran.r-project.org/package=mrdrivers) [![R build status](https://pik-piam.github.io/mrdrivers/workflows/check/badge.svg)](https://pik-piam.github.io/mrdrivers/actions) [![codecov](https://codecov.io/gh/mrdrivers/branch/master/graph/badge.svg)](https://app.codecov.io/gh/mrdrivers) [![r-universe](https://pik-piam.r-universe.dev/badges/mrdrivers)](https://pik-piam.r-universe.dev/builds) @@ -103,7 +103,7 @@ In case of questions / problems please contact Johannes Koch . +Koch J, Soergel B, Leip D, Benke F, Dietrich J (2023). _mrdrivers: Create GDP and Population Scenarios_. R package version 1.2.1, . A BibTeX entry for LaTeX users is @@ -112,7 +112,7 @@ A BibTeX entry for LaTeX users is title = {mrdrivers: Create GDP and Population Scenarios}, author = {Johannes Koch and Bjoern Soergel and Deborra Leip and Falk Benke and Jan Philipp Dietrich}, year = {2023}, - note = {R package version 1.2.0}, + note = {R package version 1.2.1}, url = {https://pik-piam.github.io/mrdrivers}, url = {https://github.com/pik-piam/mrdrivers}, }