Title: | Classical Age-Depth Modelling of Cores from Deposits |
---|---|
Description: | Performs 'classical' age-depth modelling of dated sediment deposits - prior to applying more sophisticated techniques such as Bayesian age-depth modelling. Any radiocarbon dated depths are calibrated. Age-depth models are constructed by sampling repeatedly from the dated levels, each time drawing age-depth curves. Model types include linear interpolation, linear or polynomial regression, and a range of splines. See Blaauw (2010) <doi:10.1016/j.quageo.2010.01.002>. |
Authors: | Maarten Blaauw [aut, cre] |
Maintainer: | Maarten Blaauw <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.6.2 |
Built: | 2025-03-12 06:18:57 UTC |
Source: | https://github.com/maarten14c/clam |
Classical (non-Bayesian) age-depth modelling.
Maintainer: Maarten Blaauw [email protected] (ORCID)
Other contributors:
J. Andres Christen (ORCID) [contributor]
Judith Esquivel Vazquez [contributor]
Simon Goring [contributor]
Add dated depths to plots, e.g. to show dates that weren't used in the age-depth model
add.dates( mn, sdev, depth, cc = 1, above = 0.001, exx = 50, normal = TRUE, normalise = TRUE, t.a = 3, t.b = 4, age.res = 100, times = 20, col = rgb(1, 0, 0, 0.5), border = rgb(1, 0, 0, 0.5), rotate.axes = FALSE, mirror = TRUE, up = TRUE, BCAD = FALSE )
add.dates( mn, sdev, depth, cc = 1, above = 0.001, exx = 50, normal = TRUE, normalise = TRUE, t.a = 3, t.b = 4, age.res = 100, times = 20, col = rgb(1, 0, 0, 0.5), border = rgb(1, 0, 0, 0.5), rotate.axes = FALSE, mirror = TRUE, up = TRUE, BCAD = FALSE )
mn |
Reported mean of the date. Can be multiple dates. |
sdev |
Reported error of the date. Can be multiple dates. |
depth |
Depth of the date. |
cc |
The calibration curve to use: |
above |
Threshold for plotting of probability values. Defaults to |
exx |
Exaggeration of probability distribution plots. Defaults to |
normal |
By default, Bacon uses the student's t-distribution to treat the dates. Use |
normalise |
By default, the date is normalised to an area of 1 ( |
t.a |
The dates are treated using the student's t distribution by default ( |
t.b |
The dates are treated using the student's t distribution by default ( |
age.res |
Resolution of the date's distribution. Defaults to |
times |
The extent of the range to be calculated for each date. Defaults to |
col |
The colour of the ranges of the date. Default is semi-transparent red: |
border |
The colours of the borders of the date. Default is semi-transparent red: |
rotate.axes |
The default of plotting age on the horizontal axis and event probability on the vertical one can be changed with |
mirror |
Plot the dates as 'blobs'. Set to |
up |
Directions of distributions if they are plotted non-mirrored. Default |
BCAD |
The calendar scale of graphs is in |
Sometimes it is useful to add additional dating information to age-depth plots, e.g., to show outliers or how dates calibrate with different estimated offsets.
A date's distribution, added to an age-depth plot.
Maarten Blaauw, J. Andres Christen
base_temp_dir <- tempdir() clam_dir <- file.path(base_temp_dir, "clam_runs") dir.create(clam_dir, recursive = TRUE, showWarnings = FALSE) clam(, coredir=clam_dir, ask=FALSE) add.dates(5000, 100, 60)
base_temp_dir <- tempdir() clam_dir <- file.path(base_temp_dir, "clam_runs") dir.create(clam_dir, recursive = TRUE, showWarnings = FALSE) clam(, coredir=clam_dir, ask=FALSE) add.dates(5000, 100, 60)
Performs 'classical' age-depth modelling of dated sediment deposits - prior to applying more sophisticated techniques such as Bayesian age-depth modelling. Any radiocarbon dated depths are calibrated. Age-depth models are constructed by sampling repeatedly from the dated levels, each time drawing age-depth curves. Model types include linear interpolation, linear or polynomial regression, and a range of splines. See Blaauw (2010). <doi:10.1016/j.quageo.2010.01.002>.
Produce age-depth models for cores with dated depths.
clam( core = "Example", type = 1, smooth = NULL, prob = 0.95, its = 1000, coredir = NULL, ask = TRUE, wghts = 1, cc = 1, cc1 = "3Col_intcal20.14C", cc2 = "3Col_marine20.14C", cc3 = "3Col_shcal20.14C", cc4 = "mixed.14C", postbomb = FALSE, pb1 = "postbomb_NH1.14C", pb2 = "postbomb_NH2.14C", pb3 = "postbomb_NH3.14C", pb4 = "postbomb_SH1-2.14C", pb5 = "postbomb_SH3.14C", ccdir = "", outliers = NULL, ignore = NULL, youngest = NULL, extradates = NULL, slump = NULL, est = 1, calibt = FALSE, mixed.effect = FALSE, dmin = NULL, dmax = NULL, every = 1, yrmin = NULL, yrmax = NULL, yrsteps = 1, pbsteps = 0.01, hpdsteps = 1, BCAD = FALSE, decimals = 0, cmyr = FALSE, ageofdepth = NULL, depth = "cm", depthseq = NULL, depths.file = FALSE, thickness = 1, hiatus = NULL, remove.reverse = 0.5, times = 5, sep = ",", ext = ".csv", runname = NULL, storedat = TRUE, threshold = 1e-06, proxies = FALSE, revaxes = FALSE, revd = TRUE, revyr = TRUE, calhght = 0.3, maxhght = 0.01, mirror = TRUE, plotrange = TRUE, bty = "l", mar = c(3.5, 3, 2, 1), mgp = c(2, 1, 0), plotpdf = TRUE, plotpng = TRUE, greyscale = NULL, yrlab = NULL, dlab = NULL, calcol = rgb(0, 0.5, 0.5, 0.5), C14col = rgb(0, 0, 1, 0.5), outcol = "red", outlsize = 1, bestcol = "black", rangecol = rgb(0, 0, 0, 0.3), slumpcol = grey(0.75), plotname = TRUE, ash = FALSE, rule = 1 )
clam( core = "Example", type = 1, smooth = NULL, prob = 0.95, its = 1000, coredir = NULL, ask = TRUE, wghts = 1, cc = 1, cc1 = "3Col_intcal20.14C", cc2 = "3Col_marine20.14C", cc3 = "3Col_shcal20.14C", cc4 = "mixed.14C", postbomb = FALSE, pb1 = "postbomb_NH1.14C", pb2 = "postbomb_NH2.14C", pb3 = "postbomb_NH3.14C", pb4 = "postbomb_SH1-2.14C", pb5 = "postbomb_SH3.14C", ccdir = "", outliers = NULL, ignore = NULL, youngest = NULL, extradates = NULL, slump = NULL, est = 1, calibt = FALSE, mixed.effect = FALSE, dmin = NULL, dmax = NULL, every = 1, yrmin = NULL, yrmax = NULL, yrsteps = 1, pbsteps = 0.01, hpdsteps = 1, BCAD = FALSE, decimals = 0, cmyr = FALSE, ageofdepth = NULL, depth = "cm", depthseq = NULL, depths.file = FALSE, thickness = 1, hiatus = NULL, remove.reverse = 0.5, times = 5, sep = ",", ext = ".csv", runname = NULL, storedat = TRUE, threshold = 1e-06, proxies = FALSE, revaxes = FALSE, revd = TRUE, revyr = TRUE, calhght = 0.3, maxhght = 0.01, mirror = TRUE, plotrange = TRUE, bty = "l", mar = c(3.5, 3, 2, 1), mgp = c(2, 1, 0), plotpdf = TRUE, plotpng = TRUE, greyscale = NULL, yrlab = NULL, dlab = NULL, calcol = rgb(0, 0.5, 0.5, 0.5), C14col = rgb(0, 0, 1, 0.5), outcol = "red", outlsize = 1, bestcol = "black", rangecol = rgb(0, 0, 0, 0.3), slumpcol = grey(0.75), plotname = TRUE, ash = FALSE, rule = 1 )
core |
Name of the core, given using quotes. Defaults to the core provided with clam, |
type |
The type of age-depth model. Five different types are provided:
|
smooth |
Degree of smoothing. Gives polynomial degree for model type 2. Not relevant for
|
prob |
Confidence intervals (between 0 and 1), default |
its |
Amount of age-model iterations; defaults to |
coredir |
The directory where core runs are stored (each core in its own directory named after the core's name). |
ask |
By default, and as per R rules, clam will ask if it is OK to make or write to a directory.
Defaults to |
wghts |
Weights can be applied to dated depths as follows:
|
cc |
calibration curve for C14 dates (1, 2 or 3). |
cc1 |
For terrestrial, northern hemisphere C14 dates. |
cc2 |
For marine C14 dates. |
cc3 |
For southern hemisphere C14 dates. |
cc4 |
For mixed terrestrial/marine C14 dates. |
postbomb |
Use a postbomb curve for negative (i.e. postbomb) 14C ages. |
pb1 |
For Northern hemisphere region 1 postbomb C14 dates. |
pb2 |
For Northern hemisphere region 2 postbomb C14 dates. |
pb3 |
For Northern hemisphere region 3 postbomb C14 dates. |
pb4 |
For Southern hemisphere regions 1-2 postbomb C14 dates. |
pb5 |
For Southern hemisphere region 3 postbomb C14 dates. |
ccdir |
Directory where the calibration curves for C14 dates |
outliers |
The number of any dates to be considered outlying, e.g. |
ignore |
The number of any dates that should be ignored, e.g., |
youngest |
The age beyond which dates should be truncated (e.g., |
extradates |
Depths of any additional dates with their files of ages and probabilities. |
slump |
Upper and lower depths of sections of abrupt accumulation that should be excised, e.g., |
est |
Which point estimate to use as 'best' age. It is highly recommended to not only use these 'best' point estimates, as chronological uncertainties are often considerable and should not be ignored.
|
calibt |
Calibration based on the student-t distribution. By default, the Gaussian distribution is used ( |
mixed.effect |
Set to |
dmin |
Minimum depth of age-depth model (e.g., extrapolate). |
dmax |
Maximum depth of age-depth model (e.g., extrapolate). |
every |
Resolution at which (ages for) depths are calculated. |
yrmin |
Minimum of calendar axis of age-depth plot (calculate automatically by default). |
yrmax |
Maximum of calendar axis of age-depth plot (calculated automatically by default). |
yrsteps |
Temporal resolution at which calibrated ages are calculated (in calendar years). |
pbsteps |
Temporal resolution at which postbomb C14 ages are calibrated (in calendar years). |
hpdsteps |
Temporal resolution at which highest posterior density ranges are calibrated (in calendar years). |
BCAD |
Use BC/AD or cal BP scale. |
decimals |
Amount of decimals for rounding. |
cmyr |
Accumulation rates can be provided as yr/cm (default, |
ageofdepth |
Calculate age estimates of a specific depth. |
depth |
Depth units. |
depthseq |
Sequence of depths for which age estimates are to be calculated (default: from |
depths.file |
Use a file with depths for depthseq. |
thickness |
Thickness of the dated samples. |
hiatus |
Depths of any hiatuses, e.g., |
remove.reverse |
Proportion of age-models with reversals that can be removed before prompting a warning.
Set at |
times |
Half-range of calibration curve used to calibrate dates (multiplication factor for the dates' errors). |
sep |
Separator between the fields of the plain text file containing the dating information. |
ext |
Extension of the file containing the dating information. |
runname |
Text to add to the core name for specific runs, e.g., "MyCore_Test1" |
storedat |
Store the dates and age-model within R after a |
threshold |
Below which value should probabilities be excluded from calculations. |
proxies |
Set to |
revaxes |
Set to |
revd |
Plot depth axis in reverse. |
revyr |
Plot age axis in reverse. |
calhght |
Heights of the calibrated distributions in the age-depth plot. |
maxhght |
Maximum height of age probability distributions. |
mirror |
Plot the age distributions in "mirror" style (above and below depth). |
plotrange |
Plot the confidence ranges of the age-model. |
bty |
Type of box to be drawn around plots. Draw a box around the graph ( |
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). |
plotpdf |
Produce a pdf file of the age-depth plot. |
plotpng |
Produce a png file of the age-depth plot. |
greyscale |
Produce a grey-scale representation of all age-models (number gives resolution, e.g., 500 bins; will cancel plotting of the confidence intervals). |
yrlab |
Label of the calendar axis. Defaults to either cal BP or BC/AD. Alternative names can be provided. |
dlab |
Label of the depth axis. Defaults to |
calcol |
Colour of the calibrated distributions in the age-depth plot. |
C14col |
Colour of the calibrated ranges of the dates. |
outcol |
Colour of outlying dates. |
outlsize |
Size of symbols outlying dates. |
bestcol |
Colour of the "best" age-depth model (based on chosen value for est). |
rangecol |
Colour of plotted confidence ranges. |
slumpcol |
Colour of slump. |
plotname |
Print the core name on the graph. |
ash |
Plot all distributions at the same height. |
rule |
How should R's approx function deal with extrapolation. If |
Cores containing several 14C and/or other dates can be processed semi-automatically in order to obtain age-depth models. In the process, any 14C dates are calibrated, and age-depth curves are repeatedly drawn through point estimates sampled from the dates. Age-depth models can be based on linear interpolation, linear/polynomial regression, or cubic, smooth or locally weighted splines. For each date, the probability of a calendar year being sampled is proportionate to its calibrated probability (see Blaauw, 2010). Uncertainty ranges as well as a 'best' age-model are calculated.
Additional cores should be put in a comma-separated file in a sub-folder of the directory where the cores are stored.
By default this parent folder is called coredir="clam_runs"
(if no folder called "Cores"
already exists). If your core is called MyCore1, save MyCore1.csv as clam_runs/MyCore1/MyCore1.csv
.
Ensure that the names of the core's folder and filename's root (the part before .csv) match, e.g., using exactly similar upper- and lower case letters.
Avoid the use of spaces or non-standard (non-ASCII) characters within the file or in folder or file names. The plain text file should consist of 6 or 7 columns (also called fields), containing in the following exact order (see the example below):
Identification labels (e.g. 14C lab codes)
14C ages for 14C-dated depths; leave empty for non-14C dated depths
cal BP ages (for any non-14C dates such as the core surface; leave empty for levels with 14C dates)
errors (reported 1 standard deviation errors. This column should never be left empty. Errors should always be larger than 0)
age offsets if known (otherwise leave empty)
depths (depths in the sequence were the dated samples were taken, default unit depth="cm"; this column should never be left empty)
thicknesses of the sampled slices (optional column; leave empty for default of 1)
Add a final empty line to your core's .csv file by pressing 'Enter' after the file's last value.
These files can be made in spreadsheet software such as MS-Excel, but it is always a good idea to check the file's formatting in a plain-text editor such as WordPad. Remove any lines which contain only commas, and it is also recommended to remove quotes ()\" or \'
) in the headers or elsewhere.
Age-models for the core can then be produced by typing, e.g., clam("MyCore1")
.
By default the northern hemisphere terrestrial calibration curve is used (cc=1
, cc1="3Col_intcal20.14C"
).
To use alternative curves, change cc
to cc=2 (cc2="3Col_marine20.14C")
, cc=3 (cc3="3Col_shcal20.14C")
, cc=4 (cc4="mixed.14C")
.
You can also provide custom-built calibration curves, indicating its location using ccdir
.
The provided example (default core="Example"
) is core Quilichao-1 which was sampled from a Colombian lake (Berrio et al., 2002).
This core was chosen because it was dated at a rather high resolution, and appears to contain a hiatus (e.g., try hiatus=450
for a hiatus at 450 cm depth).
Each clam run will produce a range of files within the core's folder. One, ending with "_calibrated.txt"
contains the calibrated
age ranges of the 14C and other dates. The others will be named according to the core's name followed by the model type,
and contain the age estimates for all depths (files ending with "_ages.txt"
), settings (files ending with "_settings.txt"
)
and graphs (files ending with ".pdf"
and ".png"
).
The file containing the age estimates has 5 columns; first the depths, then the minima and maxima of the confidence intervals,
then a "best" estimate, and finally the reconstructed accumulation rates. The reported values are rounded to 0 decimals by default
(decimals=0
). Accumulation rates are in yr/cm ("deposition time") by default (cmyr=FALSE
), but can be reported in cm/yr (cmyr=TRUE
).
see Blaauw 2010 (Quaternary Geochronology 5: 512-518).
Age model construction together with a text output and files saved to a folder in the coredir/core
directory.
Maarten Blaauw <[email protected]>
Maarten Blaauw
Berrio, J.C., Hooghiemstra, H., Marchant, R., Rangel, O., 2002. Late-glacial and Holocene history of the dry forest area in the south Colombian Cauca Valley. Journal of Quaternary Science 17, 667-682
Blaauw, M., 2010. Methods and code for 'classical' age-modelling of radiocarbon sequences. Quaternary Geochronology 5, 512-518 doi:10.1016/j.quageo.2010.01.002
base_temp_dir <- tempdir() clam_dir <- file.path(base_temp_dir, "clam_runs") dir.create(clam_dir, recursive = TRUE, showWarnings = FALSE) clam(, coredir=clam_dir, ask=FALSE) clam(, coredir=clam_dir, ask=FALSE, extradates=470)
base_temp_dir <- tempdir() clam_dir <- file.path(base_temp_dir, "clam_runs") dir.create(clam_dir, recursive = TRUE, showWarnings = FALSE) clam(, coredir=clam_dir, ask=FALSE) clam(, coredir=clam_dir, ask=FALSE, extradates=470)
Calculates *for each iteration* the slope of a straight curve between
depths above and below the desired age. Requires sufficiently dense density of depths, e.g. steps=1
.
deptime.age(age, yrcm = TRUE, prob = 0.95)
deptime.age(age, yrcm = TRUE, prob = 0.95)
age |
Age to calculate deposition time (years per cm). |
yrcm |
Calculate in years per cm, or alternatively in cm per yr. |
prob |
Probability level at which to calculate the ranges. |
To calculate deposition times at an age. Before doing this, run your core in clam and store the data,
so, make sure the option storedat=TRUE
.
Renamed from previous accrate.age function to avoid confusion with accrate.age function of rbacon.
Returns (invisibly) the modelled deposition times at a specific age, a histogram and confidence ranges.
Maarten Blaauw
base_temp_dir <- tempdir() clam_dir <- file.path(base_temp_dir, "clam_runs") dir.create(clam_dir, recursive = TRUE, showWarnings = FALSE) clam(coredir=clam_dir, storedat=TRUE) dp <- deptime.age(5000) summary(dp) deptime.age(5000, yrcm=FALSE) # to calculate sedimentation times in cm/yr, so accumulation rates
base_temp_dir <- tempdir() clam_dir <- file.path(base_temp_dir, "clam_runs") dir.create(clam_dir, recursive = TRUE, showWarnings = FALSE) clam(coredir=clam_dir, storedat=TRUE) dp <- deptime.age(5000) summary(dp) deptime.age(5000, yrcm=FALSE) # to calculate sedimentation times in cm/yr, so accumulation rates
Calculates *for each iteration* the slope of a straight curve between depths
above and below the desired point. Requires sufficiently dense density of depths, e.g. yrsteps=1
.
deptime.depth(depth, yrcm = TRUE, prob = 0.95)
deptime.depth(depth, yrcm = TRUE, prob = 0.95)
depth |
The depth for which accumulation rate estimates should be calculated. |
yrcm |
Calculate in years per cm, or alternatively in cm per yr. |
prob |
Probability level at which to calculate the ranges. |
To calculate sedimentation times at a depth. Before running this, run your core in clam and store the data,
so, make sure to set storedat=TRUE
.
Renamed from previous accrate.depth function to avoid confusion with accrate.depth function of rbacon.
Returns (invisibly) the modelled deposition times for a specific depths, a histogram and confidence ranges.
Maarten Blaauw
base_temp_dir <- tempdir() clam_dir <- file.path(base_temp_dir, "clam_runs") dir.create(clam_dir, recursive = TRUE, showWarnings = FALSE) clam(coredir=clam_dir, storedat=TRUE) dp <- deptime.depth(20) summary(dp) deptime.depth(20, FALSE) # to calculate accumulation rates in cm/yr
base_temp_dir <- tempdir() clam_dir <- file.path(base_temp_dir, "clam_runs") dir.create(clam_dir, recursive = TRUE, showWarnings = FALSE) clam(coredir=clam_dir, storedat=TRUE) dp <- deptime.depth(20) summary(dp) deptime.depth(20, FALSE) # to calculate accumulation rates in cm/yr
Produce a plot of proxy values against calendar age.
plot_proxies(prox, errors = TRUE, proxcol = grey(0.5), revyr = TRUE)
plot_proxies(prox, errors = TRUE, proxcol = grey(0.5), revyr = TRUE)
prox |
Position of the proxy that should be plotted, e.g. |
errors |
Plot an error envelope. |
proxcol |
Colour of the error envelope. |
revyr |
Direction of the calendar scale ( |
Only works after running clam on the core using proxies=TRUE
. Requires a file containing the core depths as the first column,
and any proxy values on subsequent columns. Values should be separated by comma's. The file should be stored as a .csv file in the core's directory.
A plot of the age model function with proxies.
Maarten Blaauw
base_temp_dir <- tempdir() clam_dir <- file.path(base_temp_dir, "clam_runs") dir.create(clam_dir, recursive = TRUE, showWarnings = FALSE) clam(coredir=clam_dir, proxies=TRUE) plot_proxies(3) plot_proxies(3, revyr=FALSE)
base_temp_dir <- tempdir() clam_dir <- file.path(base_temp_dir, "clam_runs") dir.create(clam_dir, recursive = TRUE, showWarnings = FALSE) clam(coredir=clam_dir, proxies=TRUE) plot_proxies(3) plot_proxies(3, revyr=FALSE)