Plot routines for the MMM clustering metadata attached to a
netobject_group by cluster_mmm (or
cluster_network with cluster_by = "mmm").
Mirrors the type-driven surface of
plot.net_clustering but covers only the metrics the EM
fit produces – there is no distance matrix on an MMM clustering, so
"silhouette" / "mds" / "heatmap" aren't defined
here and the dispatcher raises a clear error if you ask for one of
those on an MMM result.
Arguments
- x
A
net_mmm_clusteringobject.- type
Character. One of
"posterior"(default; histogram of max posterior probability per sequence, coloured by cluster),"covariates"or its alias"predictors"(covariate forest plot whencluster_mmm()was run withcovariates).- combined
Logical. For
typein"covariates"or"predictors"only: whenTRUE(default), forest panels are combined into a single faceted plot; whenFALSE, a list of separate ggplots is returned.- ...
Unsupported. Supplying unused arguments raises an error.
Examples
# \donttest{
seqs <- data.frame(V1 = sample(c("A","B","C"), 40, TRUE),
V2 = sample(c("A","B","C"), 40, TRUE))
grp <- cluster_mmm(seqs, k = 2, n_starts = 1, max_iter = 20, seed = 1)
plot(attr(grp, "clustering"), type = "posterior")
#> Warning: no non-missing arguments to min; returning Inf
#> Warning: no non-missing arguments to max; returning -Inf
#> Warning: no non-missing arguments to min; returning Inf
#> Warning: no non-missing arguments to max; returning -Inf
#> Error in plot.window(...): need finite 'xlim' values
# }