getDim: getDim

View source: R/getDim.R

getDimR Documentation

getDim

Description

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

Usage

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

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.

Value

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

Author(s)

Jan Philipp Dietrich

See Also

mcalc,dimCode

Examples


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

magclass documentation built on May 29, 2024, 6:20 a.m.