No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
data-raw
data
man
tests
vignettes
.Rbuildignore
.gitignore
.travis.yml
DESCRIPTION
NAMESPACE
README-alta-strat-1.png
README-halifax-lakes-plot-1.png
README-keji-strat-1.png
README.Rmd
README.md
codecov.yml
tidypaleo.Rproj

README.md

Travis-CI Build Status Coverage Status

tidypaleo

Working with multi-proxy paleo-archive data is inherently difficult. There are multiple locations, multiple parameters, and a lot of discipline-specific norms for plot layout and notation. This package simplifies a few workflows to promote the use of R and reproducible documents in paleo-based studies.

Installation

You can install tidypaleo from github with:

# install.packages("devtools")
devtools::install_github("paleolimbot/tidypaleo")

Examples

Age-depth models

Stratigraphic diagrams

This package exposes a number of functions useful when creating stratigraphic diatrams, including facet_abundanceh(), which combines several other functions to help create stratigraphic plots using ggplot2. The geom_col_segsh() geometry draws horizontal sements, which are commonly used to show species abundance data.

library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 3.4.4
library(tidypaleo)
theme_set(theme_bw())

ggplot(keji_lakes_plottable, aes(x = rel_abund, y = depth)) +
  geom_col_segsh() +
  scale_y_reverse() +
  facet_abundanceh(vars(taxon), grouping = vars(location)) +
  labs(y = "Depth (cm)")

Relative abundance data with a discrete y axis can be drawn using geom_colh() and position_dodgev() from the ggstance package.

ggplot(halifax_lakes_plottable, aes(x = rel_abund, y = location, fill = sample_type)) +
  geom_colh(width = 0.5, position = "dodgev") +
  facet_abundanceh(vars(taxon)) +
  labs(fill = NULL, y = NULL)

Age depth models can be constructed (using age_depth_model()) and used to draw second axes on stratigraphic plots (using scale_y_depth_age()). The facet_geochem() function wraps facet_wrap(), and includes a labeller (label_geochem) that can add units, and automatically renames d15N, d13C and d18O such that they are labelled correctly.

alta_adm <- age_depth_model(
  alta_lake_bacon_ages, 
  depth = depth_cm,
  age = 1950 - age_weighted_mean_year_BP
)
#> Warning: package 'bindrcpp' was built under R version 3.4.4

ggplot(alta_lake_geochem, aes(x = value, y = depth)) +
  geom_lineh() +
  geom_point() +
  scale_y_depth_age(alta_adm, age_name = "Age (Year AD)") +
  facet_geochem_wrap(
    vars(param), 
    nrow = 1, 
    units = c(
      C = "%",
      Cu = "ppm",
      Ti = "ppm",
      d15N = "",
      d13C = ""
    )
  ) +
  labs(y = "Depth (cm)", x = NULL)