as_cal: Convert an object to a cal object

View source: R/deprec-cal.R

as_calR Documentation

Convert an object to a cal object

Description

as_cal() converts objects from other packages that represent calibrated radiocarbon dates to cal objects. Methods are currently implemented for:

  • CalDates: from rcarbon::calibrate()

  • oxcAARCalibratedDate and oxcAARCalibratedDatesList: from oxcAAR::oxcalCalibrate()

  • BchronCalibratedDates: from Bchron::BchronCalibrate()

These functions are intended for complex S3 objects from other packages. See cal() for a more generic constructor, e.g. using a data frame.

Usage

as_cal(x)

## S3 method for class 'CalDates'
as_cal(x)

## S3 method for class 'oxcAARCalibratedDatesList'
as_cal(x)

## S3 method for class 'oxcAARCalibratedDate'
as_cal(x)

## S3 method for class 'BchronCalibratedDates'
as_cal(x)

Arguments

x

object to be converted to a cal object.

Value

cal object: a data frame with two columns, year and p, representing the calibrated probability distribution. All other values are stored as attributes and can be accessed with cal_metadata().

See Also

Other functions for working with cal objects: as.CalDates.cal(), cal_metadata(), cal()


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