From 6cb5e84cc643f84643486f38babf44879beb3227 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 28 Jun 2024 09:40:30 +0200 Subject: [PATCH] bugfix HR --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- R/costsProductionCrops.R | 10 ++++++---- README.md | 6 +++--- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index dc31a86..551cd71 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '49951510' +ValidationKey: '49973922' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' diff --git a/CITATION.cff b/CITATION.cff index e964ef3..113f3a5 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: 'magpie4: MAgPIE outputs R package for MAgPIE version 4.x' -version: 2.5.10 -date-released: '2024-06-27' +version: 2.5.11 +date-released: '2024-06-28' abstract: Common output routines for extracting results from the MAgPIE framework (versions 4.x). authors: diff --git a/DESCRIPTION b/DESCRIPTION index ecb5d3b..4684b62 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: magpie4 Title: MAgPIE outputs R package for MAgPIE version 4.x -Version: 2.5.10 -Date: 2024-06-27 +Version: 2.5.11 +Date: 2024-06-28 Authors@R: c( person("Benjamin Leon", "Bodirsky", , "bodirsky@pik-potsdam.de", role = c("aut", "cre")), person("Florian", "Humpenoeder", , "humpenoeder@pik-potsdam.de", role = "aut"), diff --git a/R/costsProductionCrops.R b/R/costsProductionCrops.R index 4a4d0d3..76baa84 100644 --- a/R/costsProductionCrops.R +++ b/R/costsProductionCrops.R @@ -62,10 +62,12 @@ costsProductionCrops <- function(gdx, file = NULL, level = "regglo", type = "inv # Trade - Trade <- readGDX(gdx, "ov21_cost_trade_reg", select = list(type = "level")) - kcr <- findset("kcr") - intKcr <- intersect(kcr, getNames(Trade)) - Trade <- setNames(dimSums(Trade[, , intKcr], dim = 3), "Trade (Crops)") + Trade <- readGDX(gdx, "ov21_cost_trade_reg", select = list(type = "level"), react = "silent") + if(!is.null(Trade)) { + kcr <- findset("kcr") + intKcr <- intersect(kcr, getNames(Trade)) + Trade <- setNames(dimSums(Trade[, , intKcr], dim = 3), "Trade (Crops)") + } # TC,AEI and Land conversion can be read from the costs function diff --git a/README.md b/README.md index f236b15..637770a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MAgPIE outputs R package for MAgPIE version 4.x -R package **magpie4**, version **2.5.10** +R package **magpie4**, version **2.5.11** [![CRAN status](https://www.r-pkg.org/badges/version/magpie4)](https://cran.r-project.org/package=magpie4) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1158582.svg)](https://doi.org/10.5281/zenodo.1158582) [![R build status](https://github.com/pik-piam/magpie4/workflows/check/badge.svg)](https://github.com/pik-piam/magpie4/actions) [![codecov](https://codecov.io/gh/pik-piam/magpie4/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/magpie4) [![r-universe](https://pik-piam.r-universe.dev/badges/magpie4)](https://pik-piam.r-universe.dev/builds) @@ -39,7 +39,7 @@ In case of questions / problems please contact Benjamin Leon Bodirsky , R package version 2.5.10, . +Bodirsky B, Humpenoeder F, Dietrich J, Stevanovic M, Weindl I, Karstens K, Wang X, Mishra A, Beier F, Breier J, Yalew A, Chen D, Biewald A, Wirth S, von Jeetze P, Leip D, Crawford M, Alves M (2024). _magpie4: MAgPIE outputs R package for MAgPIE version 4.x_. doi:10.5281/zenodo.1158582 , R package version 2.5.11, . A BibTeX entry for LaTeX users is @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is title = {magpie4: MAgPIE outputs R package for MAgPIE version 4.x}, author = {Benjamin Leon Bodirsky and Florian Humpenoeder and Jan Philipp Dietrich and Miodrag Stevanovic and Isabelle Weindl and Kristine Karstens and Xiaoxi Wang and Abhijeet Mishra and Felicitas Beier and Jannes Breier and Amsalu Woldie Yalew and David Chen and Anne Biewald and Stephen Wirth and Patrick {von Jeetze} and Debbora Leip and Michael Crawford and Marcos Alves}, year = {2024}, - note = {R package version 2.5.10}, + note = {R package version 2.5.11}, url = {https://github.com/pik-piam/magpie4}, doi = {10.5281/zenodo.1158582}, }