Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sampleAges

Get sample ages from a set of Bchron calibrated dates


Description

A function for extracting sample ages from Bchron calibrated dates

Usage

sampleAges(CalDates, n_samp = 10000)

Arguments

CalDates

A list created from either BchronCalibrate.

n_samp

The desired number of samples

Details

Sometimes it is useful to have a set of sample calendar ages for your calibrated dates. For example the samples might be required to create a credible/confidence interval, or to create another non-trivial function of calibrated dates, such as differences. By default the BchronCalibrate function provides a grid of ages and an associated density, similar to OxCal. This function extracts that information and uses the sample function to output the desired number of samples

Value

A vector of length n_samp containing sample ages for the specified date

See Also

Examples

# Calibrate multiple ages and summarise them
ages <- BchronCalibrate(
  ages = c(3445, 11553, 7456), ageSds = c(50, 230, 110),
  calCurves = c("intcal20", "intcal20", "shcal20")
)
# Get samples
age_samples <- sampleAges(ages)
# Create a credible interval and the median for each date
apply(age_samples, 2, quantile, probs = c(0.05, 0.5, 0.95))

Bchron

Radiocarbon Dating, Age-Depth Modelling, Relative Sea Level Rate Estimation, and Non-Parametric Phase Modelling

v4.7.4
GPL (>= 2)
Authors
Andrew Parnell
Initial release
2021-01-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.