Generate a silhouette plot for a specified clustering partition within a
muscadet
object.
Arguments
- x
A
muscadet
object containing clustering data (usingclusterMuscadet()
).- partition
Value specifying the clustering partition to plot (
numeric
orcharacter
). It should be either the resolution or the k number of cluster (k) used for clustering depending on the clustering method (res_range
ork_range
withclusterMuscadet()
).- colors
Vector of colors for the cluster annotation (
character
vector). Default isNULL
, which uses predefined colors.- title
Character string for the title of the plot (
character
string). IfNULL
, a default title is generated.- annotations
TRUE
orFALSE
(logical
). Whether to add annotations per clusters. By default:TRUE
.
Examples
if (FALSE) { # \dontrun{
library("ggplot2")
# Load example muscadet object
data(muscadet_obj)
plotSil(muscadet_obj, partition = 0.6)
# Loop over partitions
for (p in names(muscadet_obj$clustering$clusters)) {
plot <- plotSil(muscadet_obj, p)
ggsave(paste0("plot_silhouette_", p, ".png"), plot)
}
} # }