Skip to contents

Summarises usable samples (FLAG == "ok") into site x time-bin records (e.g. per millennium), so that one long core does not dominate a validation score. Each record keeps its age window and time-slice range; expand them to one row per slice with site_bin_slices() for temporal_validation().

Usage

fossil_site_bins(
  records,
  bin_years = 1000,
  periods = c(Holocene = 11700, Lateglacial = 14700, Glacial = Inf)
)

Arguments

records

Output of neotoma_records().

bin_years

Width of the time bins (years).

periods

Upper age limits of named periods (see age_to_period()).

Value

A data.frame with RECORD (site_bin id), SITEID, SITENAME, LAT, LON, BIN, N_SAMPLES, RECORD_TYPE (macrofossil if any sample is), TAXA, AGE_MEAN, AGE_MIN, AGE_MAX, SLICE_MIN, SLICE_MAX, MAX_VALUE and PERIOD.

Examples

smp <- data.frame(siteid = "1", sitename = "A", lat = 47, long = 11,
                  variablename = "Dryas", value = c(2, 5, 1),
                  age = c(12100, 12600, 15400),
                  agetype = "Calendar years BP")
fossil_site_bins(neotoma_records(smp, "^Dryas", calibrate_c14 = FALSE))
#>    RECORD SITEID SITENAME LAT LON   BIN N_SAMPLES RECORD_TYPE  TAXA AGE_MEAN
#> 1 1_15000      1        A  47  11 15000         1 macrofossil Dryas    15400
#> 2 1_12000      1        A  47  11 12000         2 macrofossil Dryas    12350
#>   AGE_MIN AGE_MAX SLICE_MIN SLICE_MAX MAX_VALUE      PERIOD
#> 1   14900   15900      -139      -129         1     Glacial
#> 2   11600   13100      -111       -96         5 Lateglacial