Add individual or multiple calibrated dates to a plot.
draw.dates(
age,
error,
depth = c(),
cc = 1,
postbomb = FALSE,
bombalert = TRUE,
glue = 1,
as.F = TRUE,
is.F = FALSE,
is.pMC = FALSE,
deltaR = 0,
deltaSTD = 0,
thiscurve = c(),
oncurve = FALSE,
timescale = "C",
reservoir = c(),
normal = TRUE,
same.peaks = FALSE,
peak = 1,
ex = c(),
as.unit = FALSE,
t.a = 3,
t.b = 4,
prob = 0.95,
threshold = 0.001,
BCAD = FALSE,
draw.hpd = TRUE,
hpd.border = NA,
rounded = 0.1,
every = 1,
mirror = TRUE,
up = TRUE,
draw.base = TRUE,
col = rgb(0, 0, 1, 0.3),
border = col,
lwd = 1,
hpd.col = col,
cal.col = rgb(0, 0.5, 0.5, 0.35),
cal.border = cal.col,
cal.hpd.col = cal.col,
add = FALSE,
ka = FALSE,
rotate.axes = FALSE,
normalise = TRUE,
cc.col = rgb(0, 0.5, 0, 0.5),
cc.border = cc.col,
cc.lwd = 1,
cc.resample = 5,
age.lab = c(),
age.lim = c(),
age.rev = FALSE,
cal.rev = FALSE,
d.lab = c(),
d.lim = c(),
d.rev = TRUE,
labels = c(),
label.x = 1,
label.y = c(),
label.cex = 0.8,
label.col = col,
label.offset = c(0, 0),
label.adj = c(1, 0),
label.rot = 0,
cc.dir = NULL,
dist.res = 1000,
...
)A plot of the (calibrated) dates
Mean of the uncalibrated C-14 age (or multiple ages).
Error of the uncalibrated C-14 age (or ages).
Depth(s) of the date(s). Defaults to their relative positions if no depths are provided.
Calibration curve for C-14 dates (1, 2, 3, or 4, or, e.g., "IntCal20", "Marine20", "SHCal20", "nh1", "sh3", or "mixed"). If there are multiple dates but all use the same calibration curve, one value can be provided.
Whether or not this is a postbomb age. Defaults to FALSE.
Warn if a date is close to the lower limit of the IntCal curve. Defaults to postbomb=TRUE.
Glue postbomb and prebomb curves together. Defaults to 0 (none), can be 1 (IntCal20 + NH1), 2 (IntCal20 + NH2), 3 (IntCal20 + NH3), 4 (SHCal20 + SH1-2) or 5 (SHCal20 + SH3). Note that this will override the value of cc.
Whether or not to calculate ages in the F14C timescale. Defaults to as.F=TRUE, since it takes better care of asymmetric distributions and older dates close to the dating limit. If set as as.F=FALSE, the C14 timescale will be used.
Use is.F=TRUE if the date and error are entered as F14C.
Use is.pMC=TRUE if the date and error are entered as pMC.
Age offset (e.g. for marine samples). Can also be provided as option 'reservoir'.
Uncertainty of the age offset (1 standard deviation). Can also be provided within option 'reservoir'.
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). Defaults to c().
Whether or not to plot the calibration curve and then plot the dates onto this curve. Defaults to FALSE.
If oncurve is used, by default the calibration curve is plotted in the C14 age timescale. Alternatively, it can be provided as timescale="F14C" or timescale="pMC"
Reservoir age, or reservoir age and age offset.
Use the normal distribution to calibrate dates (default TRUE). The alternative is to use the t model (Christen and Perez 2009).
Have each of the individual distributions peak to the same height. Defaults to FALSE
Height multiplier for the distributions. Defaults to peak=1.
synonym for peak
If set to TRUE, the peak of the highest distribution is set to 1. Otherwise, it is set to a fraction of the axis limits (default, see 'fraction')
Value a of the t distribution (defaults to 3).
Value b of the t distribution (defaults to 4).
Probability confidence intervals (between 0 and 1).
Report only values above a threshold. Defaults to threshold=0.001.
Use cal BC/AD or cal BP scale (default cal BP).
Whether or not to draw the hpd ranges as a line
Colour of the border of the hpd intervals. Not drawn by default. Defaults to the colour of `col`.
Rounding for probabilities of reported hpd ranges. Defaults to 1 decimal.
Yearly precision of hpds (defaults to every=1).
Plot distributions mirrored, a bit like a swan. Confuses some people but looks nice to the author so is the default.
If mirror is set to FALSE, the distribution can be plotted facing upwards or downwards.
By default, the base of the calibrated distributions is plotted. This can be avoided by supplying draw.base=FALSE as an option.
Colour of the inside of the distribution
Colour of the border of the distribution. Defaults to the colour of `col`.
Line width of the distribution
Colour of the hpd rectangle for all dates or radiocarbon dates. Defaults to the colour of `col`.
Colour of the inside of distribution of non-radiocarbon dates that didn't need calibration
Colour of the border of the distribution of non-radiocarbon dates that didn't need calibration. Defaults to the colour of `cal.col`.
Colour of the hpd rectangle for cal BP dates. Defaults to the colour of `cal.col`.
Whether or not to add the dates to an existing plot. If set to FALSE (default), a plot will be set up.
Whether or not to plot ages as thousands of years. Defaults to ka=FALSE.
By default, the calendar age axis is plotted on the horizontal axis, and depth/position on the vertical one. Use rotate.axes=TRUE to rotate the axes.
If TRUE, the age distributions are normalised by plotting each distribution with the same total area. Precise dates will therefore peak higher than less precise dates (default). If normalise=FALSE, the peak of each date will be drawn at the same height.
Colour of the calibration curve. Default semi-transparent darkgreen.
Colour of the edges of the calibration curve. Default semi-transparent darkgreen.
Line width of the calibration curve.
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.
Title of the calendar axis (if present)
Limits of the calendar axis (if present)
Reverse the age axis. Defaults to TRUE
Synonym for age.rev
Title of the vertical axis (if present)
Limits of the vertical axis (if present)
Reverse the y-axis. Defaults to TRUE
Add labels to the dates. Empty by default.
Horizontal position of the date labels. By default draws them before the youngest age (1), but can also draw them after the oldest age (2), or above its mean (3).
Vertical positions of the depths/labels. Defaults to 0 (or 1 if label.x is 3 or 4).
Size of labels.
Colour of the labels. Defaults to the colour given to that of the dates.
Offsets of the positions of the depths/labels, giving the x and y offsets. Defaults to c(0,0).
Justification of the labels. Follows R's adj option: A value of "0" produces left-justified text, "0.5" (the default) centered text and "1" right-justified text.
Rotation of the label. 0 by default (horizontal).
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".
Resolution of the age range capturing all distributions. Defaults to dist.res=1000.
Additional plotting options
plot(0, xlim=c(500,0), ylim=c(0, 2))
draw.dates(130, 20, depth=1, bombalert=FALSE)
x <- sort(runif(10, 1000, 10000)) # draw 10 random calendar ages
cc <- rintcal::ccurve() # get the calibration curve
y <- approx(cc[,1], cc[,2], x)$y # find the IntCal 14C ages
er <- .01 * y
draw.dates(y, er, 1:length(x), bombalert=FALSE)
# or draw on the calibration curve
draw.dates(y, er, y, d.lab="Radiocarbon age (BP)", bombalert=FALSE)
draw.ccurve(add=TRUE, cc1.col=rgb(0,.5,0,.5))
Run the code above in your browser using DataLab