Display a dendrogram as a ggplot2 layer
stat_nested_hclust(
mapping = NULL,
data = NULL,
geom = "segment",
position = "identity",
...,
inherit.aes = TRUE,
show.legend = NA
)
StatNestedHclust
An object of class StatNestedHclust
(inherits from Stat
, ggproto
, gg
) of length 4.
A mapping created using aes. Must map x OR y to a qualifier.
A nested_hclust object
Any geom that takes x, xend, y, and yend. Probably geom_segment is the only one that makes sense.
Position adjustment
Passed to the the stat/geom (see geom_segment)
Inherit aesthetics from ggplot()?
Show mapped aesthetics in the legend?
library(ggplot2)
library(dplyr, warn.conflicts = FALSE)
alta_coniss <- nested_data(
alta_lake_geochem,
qualifiers = c(age, depth, zone),
key = param,
value = value,
trans = scale
) %>%
nested_chclust_coniss()
ggplot(alta_coniss) +
stat_nested_hclust(aes(model = model, y = depth)) +
scale_y_reverse()