Learn R Programming

piar (version 0.9.0)

combine_classifications: Combine hierarchical classifications

Description

Combine hierarchical classifications by stacking one classification after another.

Usage

combine_classifications(..., sep = ".")

Value

A list with a entry for each level in the combined classification.

Arguments

...

A collection of lists, one for each classification, each giving the "digits" that represent each level in the hierarchy, as made by expand_classification() or split_classification().

sep

A character used to separate the classifications in .... The default separates levels across classifications by ".".

Examples

Run this code
# Combine an unbalanced industry classification with a balanced
# geographic classification

industry <- c("111", "112", "12")
region <- c("11", "21", "22")

combine_classifications(
  expand_classification(industry, pad = "0"),
  expand_classification(region)
)

Run the code above in your browser using DataLab