csh_from_digits {accumulate} | R Documentation |
Derive collapsing scheme from a hierarchical classification
Description
Derive a collapsing scheme where group labels collapse to their parents in the hierarchy.
Usage
csh_from_digits(x, levels = max(nchar(x)) - 1)
Arguments
x |
|
levels |
|
Value
A data frame where each consecitive pair of columns represents
one collapsing step induced by the hierarchical classification
encoded by the digits in x
.
Examples
# balanced hierarchical classification
csh_from_digits(c("111","112","121","122","123"))
csh_from_digits(c("111","112","121","122","123"),levels=1)
# unbalanced hierarchical classification
csh_from_digits(c("111","112","121","122","1221","1222"))
csh_from_digits(c("111","112","121","122","1221","1222"),levels=2)
[Package accumulate version 0.9.3 Index]