Place Text on a Dendrogram

DESCRIPTION:

Labels the current plot of the tree dendrogram with text.

USAGE:

text.tree(x, splits=T, label="yval", FUN=text, all=F, pretty=NULL,  
          digits=.Options$digits - 3) 

REQUIRED ARGUMENTS:

x
fitted model object of class tree. This is assumed to be the result of some function that produces an object with the same named components as that returned by the tree() function.

OPTIONAL ARGUMENTS:

splits
logical flag: if TRUE, then the splits in the tree are labeled with the criterion for the split.
label
a column name of x$frame; values of this will label the nodes.
FUN
the name of a labeling function, e.g. text(). If FUN= text then adj=1 puts the split label to the left of the split rather than centering it. FUN can be an interactive "brushing" function if available.
all
Logical. If TRUE, all nodes are labeled, otherwise just terminal nodes.
pretty
an integer denoting the extent to which factor levels in split labels will be abbreviated. A value of (0) signifies no abbreviation. A NULL, the default, signifies using elements of letters to represent the different factor levels.
digits
number of significant digits to include in numerical labels
Graphical parameters may also be supplied as arguments to this function (see ).

SIDE EFFECTS:

the current plot of a tree dendrogram is labeled.

SEE ALSO:

, , .

EXAMPLES:

freen.tr <- tree(freeny.y ~ freeny.x) 
plot(freen.tr) 
text(freen.tr) 

# Three different ways to label nodes
my.tree <- tree(Kyphosis~., kyphosis)

# Standard labels
plot(my.tree)
text(my.tree)

# Label nodes with misclassification counts
my.tree$frame$mylab <- misclass.tree(my.tree, detail=T)
plot(my.tree)
text(my.tree, label="mylab")

# Label splits and nodes with misclassification counts
plot(my.tree)
xy <- treeco(my.tree)
text(xy$x, xy$y-1,labels=misclass.tree(my.tree,detail=T))