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.)

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()

Value

A calGrid object containing the summed probability distribution.

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.

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")
#> # A tibble: 7 x 2 #> phase SPD #> * <chr> <list> #> 1 Phase 1 <CalGrid[,2] [11,659 × 2]> #> 2 Phase 2 <CalGrid[,2] [560 × 2]> #> 3 Phase 3 <CalGrid[,2] [473 × 2]> #> 4 Phase 4 <CalGrid[,2] [1,273 × 2]> #> 5 Phase 5 <CalGrid[,2] [1,377 × 2]> #> 6 Phase 6 <CalGrid[,2] [1,155 × 2]> #> 7 Phase 7 <CalGrid[,2] [1,327 × 2]>