Generate a silhouette plot for a specified clustering partition within a
muscadet object.
Arguments
- x
A
muscadetobject containing clustering data (usingclusterMuscadet()).- partition
Value specifying the clustering partition to plot (
numericorcharacter). It should be either the resolution or the k number of cluster (k) used for clustering depending on the clustering method (res_rangeork_rangewithclusterMuscadet()).- colors
Vector of colors for the cluster annotation (
charactervector). Default isNULL, which uses predefined colors.- title
Character string for the title of the plot (
characterstring). IfNULL, a default title is generated.- annotations
TRUEorFALSE(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)
}
} # }
