View source: R/craft-align-dendrogram.R
align_dendro | R Documentation |
Plot dendrogram tree
align_dendro(
mapping = aes(),
...,
distance = "euclidean",
method = "complete",
use_missing = "pairwise.complete.obs",
reorder_dendrogram = FALSE,
merge_dendrogram = FALSE,
reorder_group = FALSE,
k = NULL,
h = NULL,
cutree = NULL,
plot_dendrogram = TRUE,
plot_cut_height = NULL,
root = NULL,
center = FALSE,
type = "rectangle",
size = NULL,
data = NULL,
no_axes = NULL,
active = NULL
)
align_dendro
initializes a ggplot data
and mapping
.
The internal ggplot
object will always use a default mapping of
aes(x = .data$x, y = .data$y)
.
The default ggplot data is the node
coordinates with edge
data attached
in ggalign
attribute, in addition, a
geom_segment
layer with a data frame of the edge
coordinates will be added when plot_dendrogram = TRUE
.
See fortify_data_frame.dendrogram()
for details.
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).
# align_dendro will always add a plot area
ggheatmap(matrix(rnorm(81), nrow = 9)) +
anno_top() +
align_dendro()
ggheatmap(matrix(rnorm(81), nrow = 9)) +
anno_top() +
align_dendro(k = 3L)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.