Learn R Programming

NeatMap (version 0.1)

draw.dendrogram3d: Draws a dendrogram in 3d

Description

Draw a dendrogram in 3d given clustering results and leaf positions. Labels at leaf tips may be specified

Usage

draw.dendrogram3d(cluster, positions, direction = c(0, 0, -1), scale = NULL,
heights = NULL, labels = NULL, label.colors = NULL, label.size = 3)

Arguments

cluster
Hierarchical clustering result of type hclust to be plotted.
positions
Positions (in 3d) of leaf tips. If 2d positions are given, these are placed in the z=0 plane.
direction
A vector specifying the direction in which the leaves point
scale
Maximum hieght of dendrogram
heights
A vector of heights, which may be used to over-ride the height information included in cluster (which are used by default if this is NULL)
labels
Vector of text labels to be placed at leaf tips.
label.colors
Vector of colors used used for labels.
label.size
Text size for labels.

Value

  • This function is called for the side effect it produces. It returns the id number of the last object drawn.

Details

May be used to validate 2D embedding results with those of cluster analysis. When cluster results and the corresponding 2D embedding are specified, this function places the positions in a rotatable environment with the cluster analysis result superposed on it. This allows the user to understand the relationship between the clustering and embedded results. Labels (or desired colors) may be placed at the leaf tips.

See Also

draw.dendrogram

Examples

Run this code
mtcars.nMDS<-nMDS(mtcars,metric="euclidean")
mtcars.cluster<-hclust(dist(mtcars),method="complete")
draw.dendrogram3d(mtcars.cluster,mtcars.nMDS$x,labels=rownames(mtcars),label.size=0.5)

Run the code above in your browser using DataLab