extractVariableGroups: extractVariableGroups

View source: R/extractVariableGroups.R

extractVariableGroupsR Documentation

extractVariableGroups

Description

Groups variable names by summation groups based on the |+| separators given in the variable names. If no |+| are present the function will try to derive summation groups based on | separators.

Usage

extractVariableGroups(x, keepOrigNames = FALSE)

Arguments

x

a vector of variable names

keepOrigNames

if set, the returned list contains the original variables (to the value of which the grouped ones have to sum up) as names instead of made up group names, if they exist. The current implementation goes up to two levels (++) deep.

Value

a named list of variable groups with group name as name and vector of entities as content

Author(s)

Anastasis Giannousakis, David Klein, Jan Philipp Dietrich

See Also

plotstyle.add

Examples

x <- c("a|+|1|+|aa","a|+|2|abc","a|+|1|+|bb","a|+|1|+|cc","a|+|3|+|aa","a|+|3|+|bb")
mip::extractVariableGroups(x)

pik-piam/mip documentation built on April 5, 2024, 12:31 p.m.