Learn R Programming

TraMineR (version 2.2-10)

disstreeleaf: Terminal node membership

Description

Get the terminal node membership of each case.

Usage

disstreeleaf(tree, label=FALSE, collapse=", ")

Value

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.

Arguments

tree

A tree (disstree or DissTreeNode object).

label

Logical. Should leaf memberships be labelled with classification rules?

collapse

Character string. Separator between categories in class of categorical values.

Author

Matthias Studer and Gilbert Ritschard)

Details

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.

See Also

disstree for examples, disstree.get.rules, and disstree.assign.