embedding_plot: Two-dimensional cluster visualisation (PCA / UMAP / t-SNE)

View source: R/manuscript-viz.R

embedding_plotR Documentation

Two-dimensional cluster visualisation (PCA / UMAP / t-SNE)

Description

Project the objects to two dimensions and colour them by cluster. "pca" uses classical MDS of the fused dissimilarity (always available); "umap" needs uwot and "tsne" needs Rtsne.

Usage

embedding_plot(
  x,
  labels,
  method = c("pca", "umap", "tsne"),
  col = NULL,
  main = NULL
)

Arguments

x

A fitted result ($DistM), a dissimilarity, or a List.

labels

Cluster label of each object.

method

"pca" (default), "umap" or "tsne".

col

Optional cluster colours.

main

Plot title.

Value

Invisibly the 2-column coordinate matrix.

See Also

cluster_selection_plot

Examples

data(mosaic_toy)
fit <- M_ABC(mosaic_toy$List, numsim = 40, NC = 3)
embedding_plot(fit, mosaic_labels(fit, 3), method = "pca")

MosaiClusteR documentation built on Oct. 25, 2026, 1:08 a.m.