plotDensityClust {densityClust} | R Documentation |
Generate a single panel of up to three diagnostic plots for a
densityClust
object.
plotDensityClust(x, type = "all", n = 20, mds = NULL, dim.x = 1,
dim.y = 2, col = NULL, alpha = 0.8)
x |
A densityCluster object as produced by |
type |
A character vector designating which figures to produce. Valid
options include |
n |
Number of observations to plot in the gamma graph. |
mds |
A matrix of scores for observations from a Principal Components Analysis or MDS. If omitted, and a MDS plot has been requested, one will be calculated. |
dim.x, dim.y |
The numbers of the dimensions to plot on the x and y axes of the MDS plot. |
col |
Vector of colors for clusters. |
alpha |
Value in |
A panel of the figures specified in type
are produced.
If designated, clusters are color-coded and labelled. If present in
x
, the rho and delta thresholds are designated in the
decision graph by a set of solid black lines.
Eric Archer eric.archer@noaa.gov
data(iris)
data.dist <- dist(iris[, 1:4])
pca <- princomp(iris[, 1:4])
# Run initial density clustering
dens.clust <- densityClust(data.dist)
op <- par(ask = TRUE)
# Show the decision graph
plotDensityClust(dens.clust, type = "dg")
# Show the decision graph and the gamma graph
plotDensityClust(dens.clust, type = c("dg", "gg"))
# Cluster based on rho and delta
new.clust <- findClusters(dens.clust, rho = 4, delta = 2)
# Show all graphs with clustering
plotDensityClust(new.clust, mds = pca$scores)
par(op)