diff --git a/.buildlibrary b/.buildlibrary index 9a9b8107..e64d0337 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '27036960' +ValidationKey: '27125602' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d2e4ca9..7a47c414 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.9019 + rev: v0.3.2.9021 hooks: - id: parsable-R - id: deps-in-desc diff --git a/CITATION.cff b/CITATION.cff index 5cf4ad32..8bb38d60 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: 'mrmagpie: madrat based MAgPIE Input Data Library' -version: 1.38.0 -date-released: '2023-08-23' +version: 1.38.1 +date-released: '2023-10-12' abstract: Provides functions for MAgPIE country and cellular input data generation. authors: - family-names: Karstens diff --git a/DESCRIPTION b/DESCRIPTION index 34e2f011..b508fafe 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrmagpie Title: madrat based MAgPIE Input Data Library -Version: 1.38.0 -Date: 2023-08-23 +Version: 1.38.1 +Date: 2023-10-12 Authors@R: c( person("Kristine", "Karstens", , "karstens@pik-potsdam.de", role = c("aut", "cre")), person("Jan Philipp", "Dietrich", , "dietrich@pik-potsdam.de", role = "aut"), diff --git a/R/calcDegradationYieldReduction.R b/R/calcDegradationYieldReduction.R index 8cfdbd60..588514d8 100644 --- a/R/calcDegradationYieldReduction.R +++ b/R/calcDegradationYieldReduction.R @@ -12,18 +12,17 @@ #' calcDegradationYieldReduction <- function() { -# create a dummy data set, which is later used to define yield impacts of land degradation -cells <- toolGetMapping("CountryToCellMapping.csv", type = "cell")[, "celliso"] -x <- new.magpie(cells_and_regions = cells, - years = seq(1995, 2150, 5), - names = c("soil_loss", "poll_loss"), - sets = c("region.cell", "year", "data1"), - fill = 0) + # create a dummy data set, which is later used to define yield impacts of land degradation + cells <- toolGetMapping("CountryToCellMapping.csv", type = "cell", where = "mappingfolder")[, "celliso"] + x <- new.magpie(cells_and_regions = cells, + years = seq(1995, 2150, 5), + names = c("soil_loss", "poll_loss"), + sets = c("region.cell", "year", "data1"), + fill = 0) -return(list( - x = x, - weight = NULL, - unit = "dummy (none)", - description = "Dummy file for yield reduction coefficients to represent land degradation", - isocountries = FALSE)) + return(list(x = x, + weight = NULL, + unit = "dummy (none)", + description = "Dummy file for yield reduction coefficients to represent land degradation", + isocountries = FALSE)) } diff --git a/R/calcPastrTauHist.R b/R/calcPastrTauHist.R index a7db1c8f..e5decfe8 100644 --- a/R/calcPastrTauHist.R +++ b/R/calcPastrTauHist.R @@ -57,7 +57,7 @@ calcPastrTauHist <- function(past_mngmt = "2me") { # nolint t <- collapseNames(t) # replacing unrealistic high tau values by regional averages - regMap <- toolGetMapping("regionmappingH12.csv", type = "cell") + regMap <- toolGetMapping("regionmappingH12.csv", type = "cell", where = "madrat") tReg <- toolAggregate(t, rel = regMap, weight = area, from = "CountryCode", to = "RegionCode") regions <- regMap$RegionCode names(regions) <- regMap[, "CountryCode"] diff --git a/R/calcPastureSuit.R b/R/calcPastureSuit.R index 573264e6..a0a12d22 100644 --- a/R/calcPastureSuit.R +++ b/R/calcPastureSuit.R @@ -90,7 +90,7 @@ calcPastureSuit <- function(climatetype = "MRI-ESM2-0:ssp126", lpjml = "LPJmL4_ pastLy <- pastLy[length(pastLy)] # past last year future <- setdiff(getYears(pastureSuitArea), pastAll) - map <- toolGetMapping("CountryToCellMapping.csv", type = "cell") + map <- toolGetMapping("CountryToCellMapping.csv", type = "cell", where = "mappingfolder") pastureSuitAreaReg <- toolAggregate(pastureSuitArea, rel = map, from = "celliso", to = "iso") histPastrReg <- toolAggregate(histPastr, rel = map, from = "celliso", to = "iso") calibReg <- histPastrReg[, pastLy, ] / pastureSuitAreaReg[, pastLy, ] diff --git a/README.md b/README.md index 581ae19d..2542f895 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # madrat based MAgPIE Input Data Library -R package **mrmagpie**, version **1.38.0** +R package **mrmagpie**, version **1.38.1** [![CRAN status](https://www.r-pkg.org/badges/version/mrmagpie)](https://cran.r-project.org/package=mrmagpie) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4319612.svg)](https://doi.org/10.5281/zenodo.4319612) [![R build status](https://github.com/pik-piam/mrmagpie/workflows/check/badge.svg)](https://github.com/pik-piam/mrmagpie/actions) [![codecov](https://codecov.io/gh/pik-piam/mrmagpie/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrmagpie) [![r-universe](https://pik-piam.r-universe.dev/badges/mrmagpie)](https://pik-piam.r-universe.dev/builds) @@ -39,7 +39,7 @@ In case of questions / problems please contact Kristine Karstens . +Karstens K, Dietrich J, Chen D, Windisch M, Alves M, Beier F, v. Jeetze P, Mishra A, Humpenoeder F, Führlich P (2023). _mrmagpie: madrat based MAgPIE Input Data Library_. doi: 10.5281/zenodo.4319612 (URL: https://doi.org/10.5281/zenodo.4319612), R package version 1.38.1, . A BibTeX entry for LaTeX users is @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is title = {mrmagpie: madrat based MAgPIE Input Data Library}, author = {Kristine Karstens and Jan Philipp Dietrich and David Chen and Michael Windisch and Marcos Alves and Felicitas Beier and Patrick {v. Jeetze} and Abhijeet Mishra and Florian Humpenoeder and Pascal Führlich}, year = {2023}, - note = {R package version 1.38.0}, + note = {R package version 1.38.1}, doi = {10.5281/zenodo.4319612}, url = {https://github.com/pik-piam/mrmagpie}, }