makeDendrite {plotrix} | R Documentation |
Build a list of mutually exclusive attributes from a matrix of category indicators.
makeDendrite(x)
x |
A data frame or matrix where rows represent objects and columns mutually exclusive attributes of a given class. |
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.
A list of the counts of objects for each combination of the attribute classes.
Jim Lemon
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