Learn R Programming

TraMineR (version 2.2-10)

disstree.assign: Assign rules to profiles provided

Description

Find the tree classification rule that applies to provided cases.

Usage

disstree.assign(rules, profile, covar=attr(rules,"covariates"))

Value

A vector of length equal to the number of rows of profile with for each case the index of the rule that applies.

Arguments

rules

Character vector. List of classification rules such as those returned by disstree.get.rules.

profile

Data frame. Profiles of cases to be classified with the rules.

covar

Character vector. List of names of covariates used by the rules.

Author

Gilbert Ritschard)

Details

rules must be given as strings of R commands. Use disstree.get.rules to get the classification rules of a tree of class disstree.

Rules are expected to create a full partition of the space of possible values of the covariates, i.e., any profile must satisfy one and only one of the rules.

See Also

disstree, disstreeleaf, disstree.get.rules