c14_sum: Sum radiocarbon dates with tidy syntax

View source: R/deprec-c14.R

c14_sumR Documentation

Sum radiocarbon dates with tidy syntax

Description

A wrapper for rcarbon::spd() that takes a list of calibrated dates rather than a CalDates object. This allows you to use the output of c14_calibrate() and take advantage of tidy summary syntax (dplyr::group_by(), etc.)

Usage

c14_sum(cal, time_range = NA, ...)

Arguments

cal

A list of cal objects.

time_range

Vector of length 2 indicating the range of calendar dates over which to sum. If left NA, the maximum range of the cal will be used. See details.

...

Optional arguments to be passed to rcarbon::spd()

Details

Unlike rcarbon::spd(), this function will attempt to guess an appropriate time range if it isn't explicitly specified with time_range. It's probably a good idea to specify it.

Value

A calGrid object containing the summed probability distribution.

See Also

Other tidy radiocarbon functions: c14_calibrate(), cal()

Examples

data("shub1_radiocarbon")
shub1_radiocarbon %>%
  dplyr::mutate(cal = c14_calibrate(cra, error, normalise = FALSE, verbose = FALSE)) %>%
  dplyr::group_by(phase) %>%
  dplyr::summarise(SPD = c14_sum(cal, spdnormalised = TRUE, verbose = FALSE),
                   .groups = "drop_last")

joeroe/stratigraphr documentation built on May 17, 2023, 9:52 p.m.