plot.linkage | R Documentation |
Creates plots for visualizing an object of class "linkage"
.
## S3 method for class 'linkage'
plot(x, type = c("rectangle", "triangle"),
center = FALSE, edge.root = FALSE,
nodePar = NULL, edgePar = list(),
leaflab = c("perpendicular", "textlike", "none"),
dLeaf = NULL, xlab = "", ylab = "", xaxt = "n", yaxt = "s",
horiz = FALSE, frame.plot = FALSE, xlim, ylim,
col.rng = "lightgray", ...)
x |
An object of class |
type |
Type of plot. |
center |
Logical; if |
edge.root |
Logical; if true, draw an edge to the root node. |
nodePar |
A |
edgePar |
A |
leaflab |
A string specifying how leaves are labeled. The default
|
dLeaf |
A number specifying the distance in user coordinates between the
tip of a leaf and its label. If |
xlab , ylab |
A label for the axis. |
xaxt , yaxt |
A character which specifies the axis type. Specifying "n" suppresses plotting, while any value other than "n" implies plotting. |
horiz |
Logical indicating if the dendrogram should be drawn horizontally or not. |
frame.plot |
Logical indicating if a box around the plot should be drawn,
see |
xlim , ylim |
Optional x- and y-limits of the plot, passed to
|
col.rng |
Color ("lightgray" by default) to be used for plotting range
rectangles in case of tied heights. If |
... |
Graphical parameters (see |
Based on the plot function for objects of class "dendrogram"
(see
plot.dendrogram
), the plot function for objects of class
"linkage"
adds the possibility of visualizing the existence of tied
heights in a dendrogram thanks to the col.rng
parameter.
linkage
, dendrogram
.
## Plot complete linkage of mtcars distances, showing and hiding ranges
mtcars.dist <- dist(scale(mtcars)) # distances of standardized data
lnk <- linkage(mtcars.dist, digits = 1, method = "complete")
par(mfrow = c(1, 2))
nodePar <- list(cex = 0, lab.cex = 0.4)
plot(lnk, col.rng = "bisque", main = "show ranges", nodePar = nodePar)
plot(lnk, col.rng = NULL, main = "hide ranges", nodePar = nodePar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.