# A simple aggregation structure
# 1
# |-----+-----|
# 11 12
# |---+---| |
# 111 112 121
# (1) (3) (4)
aggregation_weights <- data.frame(
level1 = c("1", "1", "1"),
level2 = c("11", "11", "12"),
ea = c("111", "112", "121"),
weight = c(1, 3, 4)
)
aggregation_structure(
aggregation_weights[1:3],
weights = aggregation_weights[[4]]
)
# The aggregation structure can also be made by expanding the
# elemental aggregates
with(
aggregation_weights,
aggregation_structure(expand_classification(ea), weight)
)
Run the code above in your browser using DataLab