From a49edd1a3d503086d109ec7940df3966dfb1d0a4 Mon Sep 17 00:00:00 2001 From: florianh Date: Sat, 6 Apr 2024 20:47:05 +0200 Subject: [PATCH] bugfix ERROR: [cellSize] source and target filename cannot be the same --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- R/readGPM2.R | 3 ++- README.md | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 6879bda2..16355464 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '285577380' +ValidationKey: '285611609' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' diff --git a/CITATION.cff b/CITATION.cff index d8720b35..e85cacbf 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.44.10 -date-released: '2024-04-05' +version: 1.44.11 +date-released: '2024-04-06' abstract: Provides functions for MAgPIE country and cellular input data generation. authors: - family-names: Karstens diff --git a/DESCRIPTION b/DESCRIPTION index e29b37e5..2a66288e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrmagpie Title: madrat based MAgPIE Input Data Library -Version: 1.44.10 -Date: 2024-04-05 +Version: 1.44.11 +Date: 2024-04-06 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/readGPM2.R b/R/readGPM2.R index c5e23e8a..3bac09f7 100644 --- a/R/readGPM2.R +++ b/R/readGPM2.R @@ -24,7 +24,8 @@ readGPM2 <- function() { r2 <- terra::project(r1, "+proj=longlat +datum=WGS84", method = "near") # get cell area - a <- terra::cellSize(r2, unit = "ha", mask = TRUE) * 1e-6 + a <- terra::cellSize(r2, unit = "ha", mask = TRUE) + a <- a * 1e-6 # project or aggregate to 0.5 degree # use terra::aggregate because terra::project(a, terra::rast(res = 0.5), method = "sum") is not working diff --git a/README.md b/README.md index b054524f..1745ef7f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # madrat based MAgPIE Input Data Library -R package **mrmagpie**, version **1.44.10** +R package **mrmagpie**, version **1.44.11** [![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 , R package version 1.44.10, . +Karstens K, Dietrich J, Chen D, Windisch M, Alves M, Beier F, Köberle A, v. Jeetze P, Mishra A, Humpenoeder F, Sauer P (2024). _mrmagpie: madrat based MAgPIE Input Data Library_. doi:10.5281/zenodo.4319612 , R package version 1.44.11, . 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 Alexandre Köberle and Patrick {v. Jeetze} and Abhijeet Mishra and Florian Humpenoeder and Pascal Sauer}, year = {2024}, - note = {R package version 1.44.10}, + note = {R package version 1.44.11}, doi = {10.5281/zenodo.4319612}, url = {https://github.com/pik-piam/mrmagpie}, }