magclass (version 4.107.0)

magpie_expand: magpie_expand

Description

Expands a MAgPIE object based on a reference

Usage

magpie_expand(x, ref)

Arguments

x

MAgPIE object that should be expanded

ref

MAgPIE object that serves as a reference

Value

An expanded version of x.

Details

Expansion means here that the dimensions of x are expanded acordingly to ref. Please note that this is really only about expansion. In the case that one dimension of ref is smaller than of x nothing happens with this dimension. At the moment magpie_expand is only internally available in the magclass library

You can influence the verbosity of this function by setting the option "magclass.verbosity". By default verbosity is set to 2 which means that warnings as well as notes are returned. Setting verbosity to 1 means that only warnings are returned but no notes. This is done by options(verbosity.level=1)

Currently magpie_expand is prepared to be updated to a newer version. By default the old setup is currently active. To switch to the new setup you have to set options(magclass_version=2).

By default expansion is based on the elements in a dimension ignoring the set name of the dimension. To expand based on set names instead of contents (recommended) you can switch options(magclass_setMatching=TRUE).

See Also

as.magpie, options

Examples

Run this code
# NOT RUN {
 a <- new.magpie(c("AFR","CPA"),"y1995",c("m","n"))
 b <- new.magpie("GLO","y1995",c("bla","blub"))
 magpie_expand(b,a)
 options(magclass.verbosity=1)
 magpie_expand(b,a)

# }

Run the code above in your browser using DataLab