Learn R Programming

plotrix (version 3.7-8)

makeDendrite: Build a list of the mutually exclusive attributes of objects

Description

Build a list of mutually exclusive attributes from a matrix of category indicators.

Usage

makeDendrite(x)

Arguments

x

A data frame or matrix where rows represent objects and columns mutually exclusive attributes of a given class.

Value

A list of the counts of objects for each combination of the attribute classes.

Details

The values in x indicate which attribute of a particular class is possessed by the object. For instance, the attributes dead and alive are mutually exclusive. makeDendrite creates a nested list that contains the counts of successive combinations of the attributes. The top level attributes are taken from the first column, then those are combined with the attributes in the second column and so on.

See Also

plot.dendrite

Examples

Run this code
# NOT RUN {
 sex<-sample(c("M","F"),100,TRUE)
 hair<-sample(c("Blond","Black","Brown","Red"),100,TRUE)
 eye<-sample(c("Blue","Black","Brown","Green"),100,TRUE)
 charac<-data.frame(sex=sex,hair=hair,eye=eye)
 characlist<-makeDendrite(charac)
 characlist
# }

Run the code above in your browser using DataLab