Turns Neotoma samples (from download_neotoma() or any table with the
same columns) into dated records of your taxon: each sample with its
own age, an age window for matching it to climate time slices, and a
flag explaining why a sample is not usable. Uncalibrated radiocarbon ages
are calibrated with IntCal20 (package rintcal; see
calibrate_radiocarbon()).
Usage
neotoma_records(
samples,
taxon_regex,
area = NULL,
min_value = 0,
age_unc_default = 500,
age_unc_min = 100,
max_age = 22000,
calibrate_c14 = TRUE,
c14_err_default = 100,
slice_fun = trace21k_id
)Arguments
- samples
Sample table (columns found case-insensitively: siteid, sitename, lat, long/lon, datasetid, datasettype, sampleid, depth, variablename/taxonname, elementtype, value, units, age, ageolder, ageyounger, agetype).
- taxon_regex
Regular expression for the taxon names kept, e.g.
"^Dryas".- area
Optional area: a raster (cells with values = inside) or polygons (
sf, terra::SpatVector or path).- min_value
Samples with
value <= min_valueare flagged.- age_unc_default, age_unc_min
Age half-window (years) when none is stated, and its minimum.
- max_age
Oldest age covered by the climate data (cal BP; 22000 for CHELSA-TraCE21k).
- calibrate_c14
Calibrate radiocarbon ages (needs
rintcal).- c14_err_default
Laboratory error (14C years) when none is given.
- slice_fun
Function converting ages (cal BP) to time-slice IDs.
Value
A data.frame, one row per sample, with SITEID, SITENAME,
LAT, LON, DATASETID, DATASETTYPE, SAMPLEID, DEPTH, TAXON,
ELEMENT, VALUE, UNITS, AGE, AGE_OLDER, AGE_YOUNGER,
AGETYPE, AGE_SOURCE, AGE_MIN, AGE_MAX, SLICE, SLICE_MIN,
SLICE_MAX, RECORD_TYPE (pollen / macrofossil) and FLAG.
Details
Age window. The stated older/younger bounds, or +/- age_unc_default
years, never narrower than +/- age_unc_min. The window is converted to
climate time slices by slice_fun (default: the century IDs of
CHELSA-TraCE21k, see trace21k_id()).
Flags: ok, outside_area (outside area, e.g. M, which also
removes regions where other taxa of the genus occur), zero_value,
no_age, not_calendar_age, older_than_max.
References
Williams, J.W., Grimm, E.C., Blois, J.L., et al. (2018) The Neotoma Paleoecology Database, a multiproxy, international, community- curated data resource. Quaternary Research 89, 156-177. doi:10.1017/qua.2017.105
Examples
smp <- data.frame(siteid = c("1", "1", "2"), sitename = c("A", "A", "B"),
lat = c(47, 47, 60), long = c(11, 11, 10),
datasetid = "9", datasettype = "pollen",
variablename = c("Dryas", "Betula", "Dryas octopetala"),
value = c(3, 10, 1), age = c(12500, 12500, 25000),
agetype = "Calendar years BP")
neotoma_records(smp, taxon_regex = "^Dryas", calibrate_c14 = FALSE)
#> SITEID SITENAME LAT LON DATASETID DATASETTYPE SAMPLEID DEPTH TAXON
#> 1 1 A 47 11 9 pollen <NA> NA Dryas
#> 2 2 B 60 10 9 pollen <NA> NA Dryas octopetala
#> ELEMENT VALUE UNITS AGE AGE_OLDER AGE_YOUNGER AGETYPE AGE_SOURCE
#> 1 <NA> 3 <NA> 12500 NA NA Calendar years BP neotoma
#> 2 <NA> 1 <NA> 25000 NA NA Calendar years BP neotoma
#> AGE_MIN AGE_MAX SLICE SLICE_MIN SLICE_MAX RECORD_TYPE FLAG
#> 1 12000 13000 -105 -110 -100 pollen ok
#> 2 24500 25500 -200 -200 -200 pollen older_than_max
