Label a Cluster Plot

DESCRIPTION:

Places labels on a hierarchical clustering plot.

USAGE:

labclust(x, y, labels = <<see below>>) 

REQUIRED ARGUMENTS:

x,y
coordinates of points. The coordinates can be given by two vector arguments or by a single arguments x which is a times series, a two-column matrix, or a list containing components named x and y. Typically, these are the coordinates of the leaves of the tree, as produced by plclust. Missing values ( NAs) are allowed.

OPTIONAL ARGUMENTS:

labels
control of labels on the cluster leaves. By default, leaves are labeled with the object number. If labels is a character vector, it is used to label the leaves. Otherwise it is interpreted as a logical flag (in particular, the value FALSE suppresses any labeling of leaves, as is appropriate with large trees).

Missing values are not accepted.

Graphical parameters may also be supplied as arguments to this function (see ). In addition, the high-level graphics arguments described under and the arguments to may be supplied to this function.

SIDE EFFECTS:

labels are added to the current plot, which should be a cluster plot.

DETAILS:

The horizontal distance between leaves is 1, and the left-most leaf has "x" coordinate 1, the fifth from the left has coordinate 5, etc.

SEE ALSO:

, , , , .

EXAMPLES:

# create a sample object using built-in dataset 
x <- hclust(dist(longley.y)) 
xy <- plclust(x, plot = FALSE)  # save coords of tree 
plclust(x, label = FALSE)  # plot it 
labclust(xy)  # now label it with the object number 
# can use a character vector of names to label the leaves 
listnames <- names(longley.y)
plclust(x, label = FALSE)  # plot it 
labclust(xy, labels=listnames) # vector is called "listnames"