disstreeleaf: Terminal node membership

View source: R/disstree.R

disstreeleafR Documentation

Terminal node membership

Description

Get the terminal node membership of each case.

Usage

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

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.

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.

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.

Author(s)

Matthias Studer and Gilbert Ritschard)

See Also

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


TraMineR documentation built on Sept. 19, 2023, 1:07 a.m.