knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
c14 provides basic classes and functions for radiocarbon data in R. It makes it easier to combine methods from several existing packages (e.g. rcarbon, Bchron, oxcAAR, c14bazAAR, ArchaeoPhases, stratigraphr) together and work with them in a tidy data workflow.
It was forked from stratigraphr v0.3.0.
You can install the development version of c14 from GitHub with the remotes package:
# install.packages("remotes") remotes::install_github(c("joeroe/controller", "joeroe/c14"))
Note that the dependency controller is also not yet available on CRAN.
The main aim of c14 is to make it easier to work with radiocarbon data within a tidy workflow.
For example, we can combine dplyr::filter()
with c14_calibrate()
to only calibrate dates from a specific site:
library("c14") library("dplyr", warn.conflicts = FALSE) ppnd |> filter(site == "Ganj Dareh") |> select(lab_id, cra, error) |> mutate(cal = c14_calibrate(cra, error))
The resulting cal
-class vector can be assigned to a new column, allowing us to keep working with the data in the context of the original data frame or tibble.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.