trade: trade

View source: R/trade.R

tradeR Documentation

trade

Description

Calculates MAgPIE trade or self-sufficiencies out of a gdx file

Usage

trade(
  gdx,
  file = NULL,
  level = "reg",
  products = "k_trade",
  product_aggr = FALSE,
  attributes = "dm",
  weight = FALSE,
  relative = FALSE,
  type = "net-exports"
)

Arguments

gdx

GDX file

file

a file name the output should be written to using write.magpie

level

Level of regional aggregation ("reg", "glo", "regglo")

products

Selection of products (either by naming products, e.g. "tece", or naming a set,e.g."kcr")

product_aggr

aggregate over products or not (boolean)

attributes

dry matter: Mt ("dm"), gross energy: PJ ("ge"), reactive nitrogen: Mt ("nr"), phosphor: Mt ("p"), potash: Mt ("k"), wet matter: Mt ("wm"). Can also be a vector.

weight

in case relative=T also the weighting for the self sufficiencies is provided as it is an intensive parameter

relative

if relative=TRUE, self sufficiencies are reported, so the amount of production divided by domestic demand

type

exports-imports ("net-exports"), gross imports ("imports") or gross exports ("exports"); only valid if relative=FALSE

Details

Trade definitions are equivalent to FAO CBS categories

Value

trade (production-demand) as MAgPIE object; unit depends on attributes

Author(s)

Benjamin Leon Bodirsky, Florian Humpenoeder, Mishko Stevanovic

Examples


  ## Not run: 
    x <- trade(gdx="fulldata.gdx", level="regglo", products="kcr")
  
## End(Not run)


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