Get the terminal node membership of each case.
disstreeleaf(tree, label=FALSE, collapse=", ")
Either a vector of leaf numbers or a factor. When label=FALSE
(default), vector of assigned terminal node numbers. When label=TRUE
, a factor with levels labelled with classification rules.
A tree (disstree
or DissTreeNode
object).
Logical. Should leaf memberships be labelled with classification rules?
Character string. Separator between categories in class of categorical values.
Matthias Studer and Gilbert Ritschard)
disstreeleaf
returns the terminal node membership of the cases either as the leaf number of the terminal node to which the cases are assigned or, when label=TRUE
, as the classification rule leading to the assigned terminal node. In the latter case, collapse
is used as separator between categorical values in classes of categorical values. The default collapse
is ", "
. It is advisable to change this default when categorical values contain commas.
disstree
for examples, disstree.get.rules
, and disstree.assign
.