flag_hierarchy: Flag aggregation by the hierarchical inheritance method

Description Usage Arguments Value Examples

Description

Flag aggregation by the hierarchical inheritance method

Usage

1
flag_hierarchy(f, flag_list)

Arguments

f

A vector of flags containing the flags of a series for a given set of flags.

flag_list

The predefined hierarchy of allowed flags as a vector of single characters.

Value

flag_hierarchy returns the flag as single character that is the highest place in the predifined hierarchy order for the given set of flags.

Examples

1
2
3
4
5
6
flag_hierarchy(c("p","b","s","b","u","e","b"), flag_list = c("e","s","t"))
flag_hierarchy(c("p","b","s","c","u","d"), flag_list = c("e","s","t"))

flags <- tidyr::spread(test_data[, c(1:3)], key = time, value = flags)
flag_hierarchy(flags[,4],flag_list = c("p","b","s","c","u","e","d"))
apply(flags[, c(2:ncol(flags))],2, flag_hierarchy, flag_list = c("p","b","s","c","u","e","d"))

eurostat/flagr documentation built on May 26, 2019, 4:39 p.m.