stat_nested_hclust: Display a dendrogram as a ggplot2 layer

View source: R/nested_chclust.R

stat_nested_hclustR Documentation

Display a dendrogram as a ggplot2 layer

Description

Display a dendrogram as a ggplot2 layer

Usage

stat_nested_hclust(
  mapping = NULL,
  data = NULL,
  geom = "segment",
  position = "identity",
  ...,
  inherit.aes = TRUE,
  show.legend = NA
)

StatNestedHclust

Arguments

mapping

A mapping created using aes. Must map x OR y to a qualifier.

data

A nested_hclust object

geom

Any geom that takes x, xend, y, and yend. Probably geom_segment is the only one that makes sense.

position

Position adjustment

...

Passed to the the stat/geom (see geom_segment)

inherit.aes

Inherit aesthetics from ggplot()?

show.legend

Show mapped aesthetics in the legend?

Format

An object of class StatNestedHclust (inherits from Stat, ggproto, gg) of length 4.

Value

A ggplot2::Stat

Examples

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()


paleolimbot/tidypaleo documentation built on Jan. 25, 2023, 2:43 a.m.