From 888e7800d25a563d6a648067e3de10bfa19eb070 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Fri, 28 Jun 2024 17:18:14 +0200 Subject: [PATCH] fix LPJmL_new warnings of negative numbers --- .buildlibrary | 2 +- CITATION.cff | 5 ++--- DESCRIPTION | 8 ++++---- R/calcLPJmL_new.R | 6 +++--- R/correctLPJmL_new.R | 2 +- README.md | 6 +++--- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 196be81..fc38d62 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '2246666' +ValidationKey: '2268828' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' diff --git a/CITATION.cff b/CITATION.cff index 4249851..f4f10ff 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: 'mrlandcore: One-line description of this awesome package' -version: 1.1.3 -date-released: '2024-06-08' +version: 1.1.4 +date-released: '2024-06-28' abstract: One-paragraph description of this awesome package. authors: - family-names: Beier @@ -36,6 +36,5 @@ authors: - family-names: Kreidenweis given-names: Ulrich license: LGPL-3.0 -keywords: ~ repository-code: https://github.com/pik-piam/mrlandcore diff --git a/DESCRIPTION b/DESCRIPTION index 8aae166..eb6cbdc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,9 @@ Type: Package Package: mrlandcore Title: One-line description of this awesome package -Version: 1.1.3 -Date: 2024-06-08 -Authors@R:c( +Version: 1.1.4 +Date: 2024-06-28 +Authors@R: c( person("Felicitas", "Beier", , "beier@pik-potsdam.de", role = c("aut", "cre")), person("Kristine", "Karstens", role = "aut"), person("Marcos", "Alves", role = "aut"), @@ -45,4 +45,4 @@ Imports: Suggests: testthat Encoding: UTF-8 -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 diff --git a/R/calcLPJmL_new.R b/R/calcLPJmL_new.R index e140393..a24bed7 100644 --- a/R/calcLPJmL_new.R +++ b/R/calcLPJmL_new.R @@ -56,14 +56,14 @@ calcLPJmL_new <- function(version = "LPJmL4_for_MAgPIE_44ac93de", # nolint if (!grepl("historical", cfg$climatetype)) { - x <- mbind(readSource("LPJmL_new", subtype = readinHist, convert = FALSE), - readSource("LPJmL_new", subtype = readinName, convert = FALSE)) + x <- mbind(readSource("LPJmL_new", subtype = readinHist, convert = "onlycorrect"), + readSource("LPJmL_new", subtype = readinName, convert = "onlycorrect")) years <- getYears(x, as.integer = TRUE) x <- x[, years[years >= 1951], ] } else { - x <- readSource("LPJmL_new", subtype = readinName, convert = FALSE) + x <- readSource("LPJmL_new", subtype = readinName, convert = "onlycorrect") years <- getYears(x, as.integer = TRUE) if (!grepl("1901", stage)) x <- x[, years[years >= 1930], ] diff --git a/R/correctLPJmL_new.R b/R/correctLPJmL_new.R index d5417d1..45035c7 100644 --- a/R/correctLPJmL_new.R +++ b/R/correctLPJmL_new.R @@ -15,7 +15,7 @@ correctLPJmL_new <- function(x) { # nolint: object_name_linter. - x <- toolConditionalReplace(x, conditions = c("is.na()", "<0"), replaceby = 0) + x <- toolConditionalReplace(x, conditions = "<0", replaceby = 0) return(x) } diff --git a/README.md b/README.md index 9f5478c..0be81ef 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # One-line description of this awesome package -R package **mrlandcore**, version **1.1.3** +R package **mrlandcore**, version **1.1.4** [![CRAN status](https://www.r-pkg.org/badges/version/mrlandcore)](https://cran.r-project.org/package=mrlandcore) [![R build status](https://github.com/pik-piam/mrlandcore/workflows/check/badge.svg)](https://github.com/pik-piam/mrlandcore/actions) [![codecov](https://codecov.io/gh/pik-piam/mrlandcore/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrlandcore) [![r-universe](https://pik-piam.r-universe.dev/badges/mrlandcore)](https://pik-piam.r-universe.dev/builds) @@ -38,7 +38,7 @@ In case of questions / problems please contact Felicitas Beier . +Beier F, Karstens K, Alves M, Philipp Dietrich J, Leon Bodirsky B, Hoetten D, Humpenoeder F, Heinke J, v. Jeetze P, Mishra A, Beier F, Wirth S, Chen D, Kreidenweis U (2024). _mrlandcore: One-line description of this awesome package_. R package version 1.1.4, . A BibTeX entry for LaTeX users is @@ -47,7 +47,7 @@ A BibTeX entry for LaTeX users is title = {mrlandcore: One-line description of this awesome package}, author = {Felicitas Beier and Kristine Karstens and Marcos Alves and Jan {Philipp Dietrich} and Benjamin {Leon Bodirsky} and David Hoetten and Florian Humpenoeder and Jens Heinke and Patrick {v. Jeetze} and Abhijeet Mishra and Felcitas Beier and Stephen Wirth and David Chen and Ulrich Kreidenweis}, year = {2024}, - note = {R package version 1.1.3}, + note = {R package version 1.1.4}, url = {https://github.com/pik-piam/mrlandcore}, } ```