diff --git a/.buildlibrary b/.buildlibrary index 78c447e..54acb1c 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '51704420' +ValidationKey: '51771052' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package .* was built under R version' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62f13da..7ccf77e 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: 7910e0323d7213f34275a7a562b9ef0fde8ce1b9 # frozen: v0.4.2 + rev: bae853d82da476eee0e0a57960ee6b741a3b3fb7 # frozen: v0.4.3 hooks: - id: parsable-R - id: deps-in-desc diff --git a/CITATION.cff b/CITATION.cff index c923883..9b683fe 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: 'mrvalidation: madrat data preparation for validation purposes' -version: 2.59.3 -date-released: '2024-08-05' +version: 2.59.4 +date-released: '2024-08-23' abstract: Package contains routines to prepare data for validation exercises. authors: - family-names: Bodirsky diff --git a/DESCRIPTION b/DESCRIPTION index 1fb42ee..1c6f2e6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrvalidation Title: madrat data preparation for validation purposes -Version: 2.59.3 -Date: 2024-08-05 +Version: 2.59.4 +Date: 2024-08-23 Authors@R: c( person("Benjamin Leon", "Bodirsky", , "bodirsky@pik-potsdam.de", role = c("aut", "cre")), person("Stephen", "Wirth", role = "aut"), diff --git a/R/calcValidFactorReqShares.R b/R/calcValidFactorReqShares.R index 3e65ae7..abedf1e 100644 --- a/R/calcValidFactorReqShares.R +++ b/R/calcValidFactorReqShares.R @@ -7,12 +7,10 @@ #' @return List of magpie objects with results on country level, weight on country level, unit and description. #' @author Debbora Leip #' @examples -#' #' \dontrun{ #' calcOutput("ValidFactorReqShares") #' } #' - calcValidFactorReqShares <- function(subtype = "crop") { if (!(subtype %in% c("crop", "livestock"))) stop("subtype must be either 'crop' or 'livestock'") @@ -51,6 +49,8 @@ calcValidFactorReqShares <- function(subtype = "crop") { weight <- weight[, years, ] out <- out[, years, ] weight[out[, , "Capital", pmatch = TRUE] == 0] <- 0 + weight[weight == 0] <- 10^-10 + return(list(x = out, weight = weight, diff --git a/README.md b/README.md index 96f6aff..d0b8c88 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # madrat data preparation for validation purposes -R package **mrvalidation**, version **2.59.3** +R package **mrvalidation**, version **2.59.4** [![CRAN status](https://www.r-pkg.org/badges/version/mrvalidation)](https://cran.r-project.org/package=mrvalidation) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4317826.svg)](https://doi.org/10.5281/zenodo.4317826) [![R build status](https://github.com/pik-piam/mrvalidation/workflows/check/badge.svg)](https://github.com/pik-piam/mrvalidation/actions) [![codecov](https://codecov.io/gh/pik-piam/mrvalidation/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrvalidation) [![r-universe](https://pik-piam.r-universe.dev/badges/mrvalidation)](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.59.3, . +Bodirsky B, Wirth S, Karstens K, Humpenoeder F, Stevanovic M, Mishra A, Biewald A, Weindl I, Beier F, Chen D, Crawford M, Leip D, Molina Bacca E, Kreidenweis U, W. Yalew A, von Jeetze P, Wang X, Dietrich J, Alves M (2024). _mrvalidation: madrat data preparation for validation purposes_. doi:10.5281/zenodo.4317826 , R package version 2.59.4, . A BibTeX entry for LaTeX users is @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is title = {mrvalidation: madrat data preparation for validation purposes}, author = {Benjamin Leon Bodirsky and Stephen Wirth and Kristine Karstens and Florian Humpenoeder and Mishko Stevanovic and Abhijeet Mishra and Anne Biewald and Isabelle Weindl and Felicitas Beier and David Chen and Michael Crawford and Debbora Leip and Edna {Molina Bacca} and Ulrich Kreidenweis and Amsalu {W. Yalew} and Patrick {von Jeetze} and Xiaoxi Wang and Jan Philipp Dietrich and Marcos Alves}, year = {2024}, - note = {R package version 2.59.3}, + note = {R package version 2.59.4}, url = {https://github.com/pik-piam/mrvalidation}, doi = {10.5281/zenodo.4317826}, } diff --git a/man/calcValidFactorReqShares.Rd b/man/calcValidFactorReqShares.Rd index bb72521..1a86101 100644 --- a/man/calcValidFactorReqShares.Rd +++ b/man/calcValidFactorReqShares.Rd @@ -17,7 +17,6 @@ calculates the validation data for labor and capital requirement shares in agric (currently the same shares for crop and livestock production based on USDA data) } \examples{ - \dontrun{ calcOutput("ValidFactorReqShares") }