Learn R Programming

clam (version 2.3.9)

calibrate: Calibrate individual 14C dates.

Description

Calibrate individual 14C dates, plot them and report calibrated ranges.

Usage

calibrate(
  cage = 2450,
  error = 50,
  reservoir = 0,
  prob = 0.95,
  cc = 1,
  cc1 = "3Col_intcal20.14C",
  cc2 = "3Col_marine20.14C",
  cc3 = "3Col_shcal20.14C",
  cc4 = "mixed.14C",
  ccdir = "",
  postbomb = FALSE,
  pb1 = "postbomb_NH1.14C",
  pb2 = "postbomb_NH2.14C",
  pb3 = "postbomb_NH3.14C",
  pb4 = "postbomb_SH1-2.14C",
  pb5 = "postbomb_SH3.14C",
  yrsteps = 1,
  pbsteps = 0.01,
  hpdsteps = 1,
  calibt = FALSE,
  yrmin = NULL,
  yrmax = NULL,
  minC14 = NULL,
  maxC14 = NULL,
  times = 5,
  calheight = 0.3,
  expand = 0.1,
  threshold = 1e-06,
  storedat = FALSE,
  graph = TRUE,
  xlab = NULL,
  ylab = NULL,
  BCAD = FALSE,
  mar = c(3.5, 3, 2, 1),
  mgp = c(1.7, 0.8, 0),
  bty = "l",
  xaxs = "i",
  yaxs = "i",
  title = NULL,
  date.col = "red",
  cc.col = rgb(0, 0.5, 0, 0.7),
  dist.col = rgb(0, 0, 0, 0.3),
  sd.col = rgb(0, 0, 0, 0.5),
  rule = 1
)

Arguments

cage

Mean of the uncalibrated C-14 age.

error

Error of the uncalibrated C-14 age.

reservoir

Reservoir age, or reservoir age and age offset.

prob

Probability confidence intervals (between 0 and 1).

cc

Calibration curve for C-14 dates (1, 2, 3, or 4).

cc1

For northern hemisphere terrestrial C-14 dates.

cc2

For marine C-14 dates.

cc3

For southern hemisphere C-14 dates.

cc4

For mixed marine/terrestrial C-14 dates.

ccdir

Directory where the calibration curves for C-14 dates cc are located. By default ccdir="". Use ccdir="." to choose current working directory. Use ccdir="/Curves" to choose sub-folder /Curves.

postbomb

Calibration curve for postbomb dates.

pb1

For Northern hemisphere region 1 postbomb C-14 dates.

pb2

For Northern hemisphere region 2 postbomb C-14 dates.

pb3

For Northern hemisphere region 3 postbomb C-14 dates.

pb4

For Southern hemisphere regions 1-2 postbomb C-14 dates.

pb5

For Southern hemisphere region 3 postbomb C-14 dates.

yrsteps

Temporal resolution at which C-14 ages are calibrated (in calendar years).

pbsteps

Temporal resolution at which postbomb C-14 ages are calibrated (in calendar years).

hpdsteps

Temporal resolution at which highest posterior density ranges are calibrated (in calendar years).

calibt

Calibration based on the student-t distribution. By default, the Gaussian distribution is used (calibt=FALSE). To use the student-t distribution, provide two parameters such as calibt=c(3,4).

yrmin

Minimum of calendar axis (default calculated automatically).

yrmax

Maximum of calendar axis (default calculated automatically).

minC14

Minimum age of the C-14 age axis (default calculated automatically).

maxC14

Maximum of the C-14 age axis (default calculated automatically).

times

Half-range of calibration curve used to calibrate dates (multiplication factor for the date's errors).

calheight

Maximum height of the C14 and calibrated distributions (as proportion of the invisible secondary axes).

expand

By which ratio should the calendar axis be expanded to fit the calibrated distribution.

threshold

Below which value should probabilities be excluded from calculations.

storedat

Store the dates within the R session after a clam run.

graph

Plot a graph of the calibrated date. If set to FALSE, only the hpd ranges will be given.

xlab

Label of the horizontal axis. Defaults to the calendar scale, but alternative names can be provided.

ylab

Label of the vertical axis. Defaults to the 14C scale, but alternative names can be provided.

BCAD

Use BC/AD or cal BP scale (default cal BP).

mar

Plot margins (amount of white space along edges of axes 1-4).

mgp

Axis text margins (where should titles, labels and tick marks be plotted).

bty

Draw a box around the graph ("n" for none, and "l", "7", "c", "u", "]" or "o" for correspondingly shaped boxes).

xaxs

Whether or not to extend the limits of the horizontal axis. Defaults to xaxs="i" which does not extend the limits.

yaxs

Whether or not to extend the limits of the vertical axis. Defaults to yaxs="i" which does not extend the limits.

title

Title of the graph. Defaults to the values of the uncalibrated date.

date.col

Colour of the "dot-bar" plot of the C14 date. Defaults to date.col="red".

cc.col

Colour of the calibration curve. Defaults to semi-transparent dark green; cc.col=rgb(0,.5,0,0.7).

dist.col

Colour of the calibrated distribution.

sd.col

Colour of calibrated range.

rule

How should R's approx function deal with extrapolation. If rule=1, the default, then NAs are returned for such points and if it is 2, the value at the closest data extreme is used.

Value

A graph of the raw and calibrated C-14 date, the calibrated ranges and, invisibly, the calibrated ranges and probabilities.

Details

Type calibrate() to see how a date of 2450 +- 50 14C BP gets calibrated (the calibration curve happens to show a plateau around this 14C age). To calibrate a different date, provide its reported mean and error (1 standard deviation error as reported by the radiocarbon laboratory) as follows: calibrate(mean, error), e.g., for a date of 130 +- 20 14C BP, type calibrate(cage=130, error=20) or, shorter, calibrate(130,20). As this date will fall partly beyond the younger extreme of the calibration curve, a warning will be given (similar warnings will be given for too old dates).

In case the date has a reservoir effect or age offset, e.g. of 100 14C years, provide this as follows: calibrate(130, 20, reservoir=100). If you want to include an uncertainty for this offset, provide this as follows, e.g., for an uncertainty of 50yr, calibrate(130,20,reservoir=c(100, 50)). The uncertainty for the age offset will then be added to the error (by taking the square root of the sum of the squared error and the squared offset uncertainty). If the carbon of your sample has mixed marine/terrestrial sources, instead apply the marine offset using mix.calibrationcurves mix.calibrationcurves, and calibrate the date using that custom-built curve.

If you prefer to work with, e.g., 68 % as opposed to the default 95 % confidence intervals, type: calibrate(130, 20, prob=0.68) or calibrate(130, 20,, 0.68) (the commas between the brackets indicate the position of the option; the standard deviation is the fourth option of the calibrate function). Clam calculates the calibrated distribution for every single calendar year (yrsteps=1) within a wide range of the 14C date (default but adaptable times=5 standard deviations or 99.999999 % of its probability distribution). This range can also be adapted by changing the option expand (default expand=0.1). Probabilities below a threshold (default threshold=1e-6) will be neglected.

By default the northern hemisphere terrestrial calibration curve is used (cc=1, cc1="3Col_intcal20.14C"). To use alternative curves, use cc=2 (cc2="3Col_marine20.14C"), cc=3 (cc3="3Col_shcal20.14C"), cc=4 (cc4="mixed.14C"), or change the file names of cc1, cc2, cc3 or cc4.

Clam works in cal BP (calendar years before AD 1950) by default, but can work with cal BC/AD through the option BCAD=TRUE.

By default the Gaussian distribution is used to calibrate dates. For use of the student-t distribution instead, provide two sensible values, e.g., calibt=c(3,4).

Calibrated distributions are usually reduced to their 68% or 95% calibrated ranges, taking into account the asymmetric and multi-peaked shape of these distributions. In clam, this is done by calculating the highest posterior density (hpd) ranges:

  • i) the probability distribution (see above) is normalised to 100%

  • ii) the calendar years are ranked according to their probabilities

  • iii) those calendar ages with a cumulative sum at or above the desired probability threshold (default 95%) are retained, and

  • iv) the extremes and probabilities of any sub-ranges within these calendar ages are reported.

Calibrated ranges at 68% will obviously result in narrower confidence intervals, and a perceived higher precision, than 95% ranges. However, given the often asymmetric and multi-modal nature of calibrated distributions, the probability that the 'true' calendar date lies outside the 1 standard deviation hpd ranges is considerable (c. 32%). Therefore the use of 95% calibrated ranges is preferable, and default in clam. The hpd ranges are calculated at yearly resolution by default (hpdsteps=1).

Negative radiocarbon ages are calibrated with postbomb curves, but the user needs to tell clam which curve to use. For example, to use the first of the three northern hemisphere curves, provide the option postbomb=1, while for southern hemisphere samples, use postbomb=4 or postbomb=5. Default curves can be changed; currently they are pb1="postbomb_NH1.14C", pb2="postbomb_NH2.14C", pb3="postbomb_NH3.14C", pb4="postbomb_SH1-2.14C" and pb5="postbomb_SH3.14C"; see http://calib.org/CALIBomb/. If no postbomb option is provided for negative radiocarbon ages, clam will report an error and refuse to calibrate the date. Given the sub-year resolution of postbomb-curves, hpd ranges are calculated at high resolution by default (pbsteps=0.01). Choose alternative values with care as they may cause unexpected results.

Generally the calculations are removed from memory after calibration; if you want to have them stored (say for subsequent manipulations), provide the option storedat=TRUE.

A graph of the calibration is produced by default (graph=TRUE), and it can be adapted in several ways. The limits of the horizontal (calendar scale) and vertical (14C scale) axes are calculated automatically but can be changed by providing alternative values for the options yrmin, yrmax, minC14 and maxC14, respectively. The titles of both axis can be changed by providing alternative titles to xlab and/or ylab, and also the top title can be adapted using title. The heights of the distributions of the 14C and calibrated ages can be set to alternative values using calheight (default 0.3 which plots the distribution up to 30% of the height of the entire graph). Parameters for white space around the graph can be changed (default mar=c(3.5, 2, 2, 1) for spacing below, to the left, above and to the right respectively), as can the spacing for the axis labels (mgp=c(2,1,0)). By default, the axes are connected at the lower left, bty="l". Check the R documentation of par() for more options.

The colours of the 14C date, the calibration curve, the entire distributions, as well as of the highest posterior density (hpd) ranges, can be changed by providing an alternative colour in date.col, cc.col, dist.col, and/or sd.col, respectively. The default colours are transparent grey for the dates probability distributions (dist.col=rgb(0,0,0, 0.3) and sd.col=rgb(0,0,0, 0.5); change the last value of rgb for different greyscale values), red for the uncalibrated mean and error bars (date.col="red"), and transparent green for the calibration curve (cc.col=rgb(0, 0.5, 0, 0.7)). R's rgb() function expects values between 0 and 1 for red, green and blue, respectively, followed by a value for the semi-transparency (also between 0 and 1). Some graphic devices such as postscript are unable to use transparency; in that case provide different colours or leave the fourth value empty.

Examples

Run this code
# NOT RUN {
calibrate()
calibrate(130, 20)
cal <- calibrate(2550, 20, reservoir=100)
cal; plot(cal$calib)
calibrate(130, 20, prob=0.68)
calibrate(cage=130, error=20)
calibrate(4450, 40, reservoir=c(100, 50))
# }

Run the code above in your browser using DataLab