align_kmeans {ggalign} | R Documentation |
Split observations by k-means clustering groups.
Description
Aligns and groups observations based on k-means clustering, enabling observation splits by cluster groups.
Usage
align_kmeans(..., data = NULL, active = NULL)
Arguments
... |
Arguments passed on to
|
data |
A numeric matrix to be used by k-means. By default, it will inherit from the layout matrix. |
active |
A |
Discrete Axis Alignment
It is important to note that we consider rows as observations, meaning
vec_size(data)
/NROW(data)
must match the number of observations along the
axis used for alignment (x-axis for a vertical stack layout, y-axis for a
horizontal stack layout).
Examples
ggheatmap(matrix(rnorm(81), nrow = 9)) +
anno_top() +
align_kmeans(3L)