magclass (version 6.13.2)

getDim: getDim

Description

Function which tries to detect the dimension to which the given elems belong

Usage

getDim(elems, x, fullmatch = FALSE, dimCode = TRUE)

Value

The name or dimCode of the dimensions in which elems were found.

Arguments

elems

A vector of characters containing the elements that should be found in the MAgPIE object

x

MAgPIE object in which elems should be searched for.

fullmatch

If enabled, only dimensions which match exactly the elements provided will be returned. Otherwise, it is sufficient if elems contains a subset of the dimension.

dimCode

If enabled, the dimCode will be returned, otherwise the name of the dimension.

Author

Jan Philipp Dietrich

See Also

mcalc,dimCode

Examples

Run this code

 pop <- maxample("pop")
 getDim(c("AFR","CPA"),pop)
 getDim(c("AFR","CPA"),pop,fullmatch=TRUE)
 getDim(c("AFR","CPA"),pop,dimCode=FALSE)
 

Run the code above in your browser using DataLab