Learn R Programming

rice (version 1.1.1)

span: The time span between two calibrated dates

Description

Calculates the timespan between two calibrated radiocarbon dates. It does this by randomly sampling ages from both calibrated dates, followed by calculating the differences between all samples ages.

Usage

span(
  y1,
  er1,
  y2,
  er2,
  n = 1e+05,
  positive = FALSE,
  cc = 1,
  postbomb = FALSE,
  deltaR = 0,
  deltaSTD = 0,
  as.F = FALSE,
  thiscurve = NULL,
  yrsteps = 1,
  cc.resample = FALSE,
  threshold = 0.001,
  normal = TRUE,
  t.a = 3,
  t.b = 4,
  cc.dir = NULL,
  visualise = TRUE,
  talk = TRUE,
  prob = 0.95,
  roundby = 1,
  bty = "l"
)

Value

The time span.

Arguments

y1

The first radiocarbon date.

er1

The lab error of the first radiocarbon date.

y2

The second radiocarbon date.

er2

The lab error of the second radiocarbon date.

n

The number of iterations to base the calculations on. Defaults to 100,000. Different values for n could significantly alter performance and accuracy.

positive

Whether or not to enforce the span to be positive. If set to TRUE, then negative span values are removed. Defaults to FALSE.

cc

Calibration curve(s) to use. Defaults to IntCal20 (cc=1). Can be a vector of length 2.

postbomb

Whether or not to use a postbomb curve. Required for negative radiocarbon ages.

deltaR

Age offset (e.g. for marine samples). Can be a vector of length 2.

deltaSTD

Uncertainty of the age offset (1 standard deviation). Can be a vector of length 2.

as.F

Whether or not to calculate ages in the F14C realm. Defaults to as.F=FALSE, which uses the C14 realm.

thiscurve

As an alternative to providing cc and/or postbomb, the data of a specific curve can be provided (3 columns: cal BP, C14 age, error).

yrsteps

Steps to use for interpolation. Defaults to the cal BP steps in the calibration curve

cc.resample

The IntCal20 curves have different densities (every year between 0 and 5 kcal BP, then every 5 yr up to 15 kcal BP, then every 10 yr up to 25 kcal BP, and then every 20 yr up to 55 kcal BP). If calibrated ages span these density ranges, their drawn heights can differ, as can their total areas (which should ideally all sum to the same size). To account for this, resample to a constant time-span, using, e.g., cc.resample=5 for 5-yr timespans.

threshold

Report only values above a threshold. Defaults to threshold=1e-6.

normal

Use the normal distribution to calibrate dates (default TRUE). The alternative is to use the t model (Christen and Perez 2016).

t.a

Value a of the t distribution (defaults to 3). Can be a vector of length 2.

t.b

Value b of the t distribution (defaults to 4). Can be a vector of length 2.

cc.dir

Directory of the calibration curves. Defaults to where the package's files are stored (system.file), but can be set to, e.g., cc.dir="curves".

visualise

Whether or not to plot the time span.

talk

Whether or not to report a summary of the span.

prob

Probability range to report. Defaults to prob=0.95.

roundby

Number of decimals to report

bty

Draw a box around a box of a certain shape. Defaults to bty="l".

Examples

Run this code
  span(2300, 20, 2350, 20)

Run the code above in your browser using DataLab