From 6dd0dab0b2d88abe6e485abdbe2950a62bd4367b Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 2 Jul 2023 21:12:51 +0200 Subject: [PATCH] bugfix price HR wood --- .buildlibrary | 2 +- CITATION.cff | 2 +- DESCRIPTION | 2 +- R/prices.R | 2 +- README.md | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index f5220133..46c1c039 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '232193820' +ValidationKey: '232213360' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' diff --git a/CITATION.cff b/CITATION.cff index 25df8378..27d07fb4 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,7 +2,7 @@ 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: 1.188.3 +version: 1.188.4 date-released: '2023-07-02' abstract: Common output routines for extracting results from the MAgPIE framework (versions 4.x). diff --git a/DESCRIPTION b/DESCRIPTION index b11d8e1e..d030036a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: magpie4 Title: MAgPIE outputs R package for MAgPIE version 4.x -Version: 1.188.3 +Version: 1.188.4 Date: 2023-07-02 Authors@R: c( person("Benjamin Leon", "Bodirsky", , "bodirsky@pik-potsdam.de", role = c("aut", "cre")), diff --git a/R/prices.R b/R/prices.R index 8f072bd6..f2fa2ae0 100644 --- a/R/prices.R +++ b/R/prices.R @@ -109,7 +109,7 @@ prices <- function(gdx, file = NULL, level = "reg", products = "kall", product_a pTrade[pTrade==0]<-NA # min as proxy for global price minVal<-suppressWarnings(as.magpie(apply(pTrade,c(2,3),min,na.rm=TRUE))) - minVal[is.infinite(minVal)]<-NA + minVal[is.infinite(minVal)]<-0 #replace NA with min value for each region, time step and item for (reg in getItems(pTrade, 1)) pTrade[reg, , ][is.na(pTrade[reg, , ])] <- minVal["GLO", , ][is.na(pTrade[reg, , ])] diff --git a/README.md b/README.md index 3787c661..096432e4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MAgPIE outputs R package for MAgPIE version 4.x -R package **magpie4**, version **1.188.3** +R package **magpie4**, version **1.188.4** [![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 1.188.3, . +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 (2023). _magpie4: MAgPIE outputs R package for MAgPIE version 4.x_. doi:10.5281/zenodo.1158582 , R package version 1.188.4, . 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 = {2023}, - note = {R package version 1.188.3}, + note = {R package version 1.188.4}, doi = {10.5281/zenodo.1158582}, url = {https://github.com/pik-piam/magpie4}, }