R/convertREMMAG.R

Defines functions convertREMMAG

convertREMMAG <- function(x, subtype) {
  map <- toolGetMapping(type = "regional", name = "regionmappingMAgPIE.csv", where = "mappingfolder")

  if (subtype == "ghgprices") {
    y <- toolAggregate(x, map)
  } else if (subtype == "biodem") {
    pop <- calcOutput("Population", aggregate = FALSE)
    y <- toolAggregate(x, map, weight = pop[, 2010, 1])
  } else {
    stop("Unknown subtype ", subtype)
  }
  return(y)
}
pik-piam/mrland documentation built on Nov. 23, 2024, 11:37 a.m.