scale_y_depth_age: Age-depth scales

View source: R/ggstrat-scales.R

scale_y_depth_ageR Documentation

Age-depth scales

Description

Age-depth scales

Usage

scale_y_depth_age(
  model = NULL,
  age_name = "age",
  age_breaks = waiver(),
  age_labels = waiver(),
  ...
)

scale_y_age_depth(
  model = NULL,
  reversed = FALSE,
  depth_name = "depth",
  depth_breaks = waiver(),
  depth_labels = waiver(),
  ...
)

scale_x_depth_age(
  model = NULL,
  age_name = "age",
  age_breaks = waiver(),
  age_labels = waiver(),
  ...
)

scale_x_age_depth(
  model = NULL,
  reversed = FALSE,
  depth_name = "depth",
  depth_breaks = waiver(),
  depth_labels = waiver(),
  ...
)

Arguments

model

An age-depth model, or NULL to suppress the second axis

age_name, depth_name

Label for the second axis

age_breaks, depth_breaks

Breaks for the second axis

age_labels, depth_labels

Labels for each break on the second axis

...

Passed to scale_y_continuous or scale_x_continuous

reversed

Reverse the primary age axis (for years BP or similar)

Value

A scale_y_continuous or scale_x_continuous

Examples

library(ggplot2)
library(dplyr, warn.conflicts = FALSE)

adm <- age_depth_model(
  alta_lake_210Pb_ages,
  depth = depth_cm, age = age_year_ad
)

alta_lake_geochem %>%
  filter(param == "Cu") %>%
  ggplot(aes(value, depth)) +
  geom_point() +
  scale_y_depth_age(adm)


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