View source: R/manuscript-viz.R
| cluster_selection_plot | R Documentation |
For a fused dissimilarity (or a fitted result, or a List of sources)
compute, over a range of k, the average silhouette width and the total
within-cluster dispersion (an elbow / scree curve), and plot them so the
chosen k can be justified in the manuscript.
cluster_selection_plot(
x,
k_range = 2:8,
linkage = "ward.D2",
select = c("both", "elbow", "silhouette"),
plot = TRUE,
point_size = 2.6,
base_size = 13
)
x |
A fitted result (with |
k_range |
Integer vector of candidate cluster counts. |
linkage |
Agglomeration method used to cut the dissimilarity. |
select |
Which criterion to show and use for |
plot |
Logical; draw the figure. |
point_size |
Marker size for the curve points. |
base_size |
Base font size for the ggplot2 theme. |
Invisibly a data frame with k, silhouette and
within_dispersion, plus attributes "best_k", "elbow_k",
"silhouette_k" and "plot" (the ggplot object).
embedding_plot, SelectnrClusters
data(mosaic_toy)
fit <- M_ABC(mosaic_toy$List, numsim = 40, NC = 3)
cluster_selection_plot(fit, k_range = 2:6, select = "elbow") # one panel
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.