Learn R Programming

avstrat (version 0.1.1)

ggstrat_column: Plot a simple stratigraphic column

Description

Uses ggplot2 to create a simple depth-only stratigraphic section plot with no variable mapped to the x-axis. Each layer is drawn as a fixed-width rectangle.

Usage

ggstrat_column(
  df,
  section_name,
  use_theme = NULL,
  ylim = NULL,
  depth_units = c("cm", "m"),
  ybreaks = 7,
  layer_fill = "layer_type",
  layer_fill_color = "stratpal_rpg",
  layer_border_color = "black",
  layer_border_linewidth = 0.2
)

Value

A ggplot object showing a schematic stratigraphic column.

Arguments

df

A data frame containing stratigraphic data. Must include columns stratsection_name, stratlayer_order, grainsize, depth, and stratlayer_type.

section_name

Character string giving the section name to filter "stratsection_name".

use_theme

A ggplot2 theme object to apply to the plot, e.g., "theme_avstrat".

ylim

Numeric vector of length 2 giving y-axis limits (optional).

depth_units

Units to use for depth (y-axis) scale, either "cm" (default) or "m".

ybreaks

Number of breaks on the y-axis.

layer_fill

Character string naming the column to use for fill. If using anything other than "layer_type" from the template, will need to make a new palette.

layer_fill_color

Palette object to use for fill colors.

layer_border_color

Border color for polygons.

layer_border_linewidth

Border line width for polygons.

Examples

Run this code
example_data_strat |>
  ggstrat_column(section_name = "21LSHD02")

Run the code above in your browser using DataLab