gdxAggregate: gdxAggregate

View source: R/gdxAggregate.R

gdxAggregateR Documentation

gdxAggregate

Description

aggregates and disaggregates on spatial scales using mappings from the gdx files. Very specific to MAgPIE.

Usage

gdxAggregate(gdx, x, weight = NULL, to, absolute = TRUE, dir = ".", ...)

Arguments

gdx

gdx file

x

object to be aggrgeagted or disaggregated

weight

weight can be either an object or a functionname in "", where the function provides the weight

to

options: grid, cell, iso, reg, glo, regglo

absolute

is it a absolute or a relative value (absolute: tons, relative: tons per hectare)

dir

for gridded outputs: magpie output directory which containts clustermap*.rds files for disaggregation.

...

further parameters handed on to weight function.

Value

List of magpie objects with results on country level, weight on country level, unit and description.

Author(s)

Benjamin Leon Bodirsky, Edna J. Molina Bacca, Florian Humpenoeder

Examples

## Not run: 
gdp_pc <- income(gdx, level = "reg")
is.function(population)
gdp_pc_iso <- gdxAggregate(gdx = gdx, x = gdp_pc, weight = "population", to = "iso",
                           absolute = FALSE)
gdp_pc_glo <- gdxAggregate(gdx = gdx, x = gdp_pc, weight = "population", to = "glo",
                           absolute = FALSE)
gdp <- income(gdx, level = "reg", per_capita = FALSE)
gdp_iso <- gdxAggregate(gdx = gdx, x = gdp, weight = "population", to = "iso", absolute = TRUE)
gdp_glo <- gdxAggregate(gdx = gdx, x = gdp, weight = "population", to = "glo", absolute = TRUE)

## End(Not run)

pik-piam/magpie4 documentation built on Dec. 20, 2024, 1:59 p.m.