| sampleDates {rcarbon} | R Documentation |
Sample random calendar dates
Description
Randomly samples calendar dates from each calibrated date or bin.
Usage
sampleDates(x, bins = NA, nsim, boot = FALSE, verbose = TRUE)
Arguments
x |
A 'CalDates' class object. |
bins |
A vector containing the bin names associated with each radiocarbon date. If set to NA, binning is not carried out. |
nsim |
Number of sampling repetitions. |
boot |
A logical value indicating whether bootstrapping is carried out (see details below). Default is FALSE. |
verbose |
A logical variable indicating whether extra information on progress should be reported. Default is TRUE. |
Details
The function randomly samples calendar dates based from calibrated probability distributions. When the bins argument is supplied a single calendar date is sampled from each bin. When boot=TRUE, dates (or bins) are randomly sampled with replacement before calendar dates are sampled.
Value
An object of class simdates with the following elements
sdatesA matrix containing the randomly sampled calendar dates, with rows containing each of thensimrepetitions.weightA vector (or matrix in whenboot=TRUE) containing the total area under the curve of each date, normalised to sum to unity. Notice this will be identical for all dates if the calibration is carried out with the argumentnormalisedset to TRUE.