View source: R/utils-selection.r
| SelectnrClusters | R Documentation |
For each element of List, partitions around medoids
(cluster::pam) are computed over a range of cluster numbers and the
average silhouette width is recorded. The number of clusters maximising the
average silhouette width is reported per source and for the across-source
average. The analytical result (the silhouette table and the chosen number
of clusters) is returned and is testable without producing any plot.
SelectnrClusters(
List,
type = c("data", "dist", "pam"),
distmeasure = c("tanimoto", "tanimoto"),
normalize = c(FALSE, FALSE),
method = c(NULL, NULL),
nrclusters = seq(5, 25, 1),
names = NULL,
StopRange = FALSE,
plottype = "none",
location = NULL
)
List |
A list of data matrices (objects in rows), distance matrices, or
|
type |
One of |
distmeasure |
Distance measure(s) used when |
normalize, method |
Normalisation controls passed to |
nrclusters |
Sequence of cluster numbers to evaluate. |
names |
Optional names for the sources; used in output labels. |
StopRange |
Logical; if |
plottype |
One of |
location |
File location (without extension) used when
|
A list with two elements: Silhoutte_Widths (a matrix of
average silhouette widths per source and their mean) and
Optimal_Nr_of_CLusters (a one-row data frame with the silhouette
optimal number of clusters per source and overall).
Kaufman, L. and Rousseeuw, P. J. (1990). Finding Groups in Data: An Introduction to Cluster Analysis. Wiley, New York.
## Not run:
data(mosaic_toy)
sel <- SelectnrClusters(mosaic_toy$List, type = "data",
distmeasure = c("euclidean", "euclidean"),
nrclusters = seq(2, 5), plottype = "none")
sel$Optimal_Nr_of_CLusters
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.