From 79abdaf6083b99befb1e8485941e0dde5c5b0624 Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:00:31 +0100 Subject: [PATCH] allow zero weight in readGasser --- NAMESPACE | 1 - R/calcValidGrassLSUha.R | 2 -- R/calcValidGridNutrientAWMS.R | 3 --- R/calcValidKcal.R | 1 - R/readGasser.R | 3 ++- 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index c656a67..60dd78e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -79,7 +79,6 @@ importFrom(magpiesets,reporthelper) importFrom(magpiesets,reportingnames) importFrom(magpiesets,summationhelper) importFrom(mrfaocore,toolFAOcombine) -importFrom(mstools,toolCell2isoCell) importFrom(mstools,toolCoord2Isocell) importFrom(mstools,toolGetMappingCoord2Country) importFrom(mstools,toolIso2CellCountries) diff --git a/R/calcValidGrassLSUha.R b/R/calcValidGrassLSUha.R index 39689ec..ed6d863 100644 --- a/R/calcValidGrassLSUha.R +++ b/R/calcValidGrassLSUha.R @@ -9,8 +9,6 @@ #' \dontrun{ #' calcOutput("ValidGrassLSUha") #' } -#' @importFrom mstools toolCell2isoCell - calcValidGrassLSUha <- function(datasource = "MAgPIEown") { if (datasource == "MAgPIEown") { diff --git a/R/calcValidGridNutrientAWMS.R b/R/calcValidGridNutrientAWMS.R index 5e2f08f..0fe87d7 100644 --- a/R/calcValidGridNutrientAWMS.R +++ b/R/calcValidGridNutrientAWMS.R @@ -12,10 +12,7 @@ #' } #' #' @importFrom magpiesets reportingnames -#' @importFrom mstools toolIso2CellCountries - calcValidGridNutrientAWMS <- function(nutrient = c("nr", "c")) { - past <- findset("past") out <- collapseNames(calcOutput("Excretion", cellular = TRUE, attributes = "npkc", aggregate = FALSE)[, past, ])[, , nutrient] diff --git a/R/calcValidKcal.R b/R/calcValidKcal.R index 1bd4dc1..16a1333 100644 --- a/R/calcValidKcal.R +++ b/R/calcValidKcal.R @@ -20,7 +20,6 @@ #' @importFrom magpiesets reporthelper #' @importFrom magclass getSets dimOrder #' @importFrom mrfaocore toolFAOcombine - calcValidKcal <- function(datasource = "FAO", nutrient = "kcal", detail = TRUE) { if (length(nutrient) > 1) { stop("select only one nutrient") diff --git a/R/readGasser.R b/R/readGasser.R index c74a920..9ff8230 100644 --- a/R/readGasser.R +++ b/R/readGasser.R @@ -117,7 +117,8 @@ readGasser <- function(subtype = "bookkeeping") { rel = mappingGasser, weight = weight[isoList, getYears(eluc), ], from = "GasserReg", - to = "ISO.Alpha3") + to = "ISO.Alpha3", + zeroWeight = "allow") weight <- collapseNames(readSource("FRA2020", "forest_area")[, , "landArea"]) missingWeightYears <- setdiff(getYears(eluc), getYears(weight))