layer_dendrogram: Add a dendrogram as a layer or facet

View source: R/ggstrat-plot_addons.R

layer_dendrogramR Documentation

Add a dendrogram as a layer or facet

Description

Add a dendrogram as a layer or facet

Usage

layer_dendrogram(
  object,
  mapping,
  ...,
  colour = "black",
  size = 0.5,
  linetype = 1,
  alpha = NA,
  sequential_facets = TRUE
)

plot_layer_dendrogram(object, mapping, ..., panel_label = "CONISS")

layer_zone_boundaries(
  object,
  mapping,
  ...,
  linetype = 2,
  alpha = 0.7,
  colour = "black",
  size = 0.5
)

Arguments

object

A nested_hclust object.

mapping

Map at least one axis (x or y) to a qualifier, like aes(x = depth) or similar.

...

Use facet_var = "CONISS" or similar to name the panel

linetype, alpha, colour, size

Customize the apperance of boundary/dendrogram segment lines

sequential_facets

TRUE will result in the panel containing the dendrogram added to the right of the plot.

panel_label

Use to label a pane on a stanalone dendrogram plot

Value

A ggplot2::layer()

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() +
  layer_dendrogram(alta_coniss, aes(y = depth)) +
  scale_y_reverse()


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