magpie2dt: Load a magpie object as data.table object with given...

View source: R/helpers.R

magpie2dtR Documentation

Load a magpie object as data.table object with given colnames. Replaces years by numeric values, removing the leading y.

Description

Load a magpie object as data.table object with given colnames. Replaces years by numeric values, removing the leading y.

Usage

magpie2dt(
  data,
  regioncol = NULL,
  yearcol = NULL,
  datacols = NULL,
  valcol = "value"
)

Arguments

data

a magpie object.

regioncol

name of the column containing REMIND regions, default is "region".

yearcol

name of the column containing the year, default is "year".

datacols

the names of the data dimension(s) of the magpie object. If no value is given, the name provided in the magpie object is used.

valcol

column to host actual value, default is "value"

Examples

## Not run: 
require(magpie)
dt <- magpie2dt(population_magpie)

## End(Not run)

pik-piam/rmndt documentation built on April 21, 2024, 4:31 a.m.