Skip to content

Commit

Permalink
allow zero weight in readGasser
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-sauer committed Nov 21, 2024
1 parent 9b4708f commit 79abdaf
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions R/calcValidGrassLSUha.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#' \dontrun{
#' calcOutput("ValidGrassLSUha")
#' }
#' @importFrom mstools toolCell2isoCell

calcValidGrassLSUha <- function(datasource = "MAgPIEown") {

if (datasource == "MAgPIEown") {
Expand Down
3 changes: 0 additions & 3 deletions R/calcValidGridNutrientAWMS.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion R/calcValidKcal.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion R/readGasser.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 79abdaf

Please sign in to comment.