spd2rc: Computes rates of change from SPDs

View source: R/utilities.R

spd2rcR Documentation

Computes rates of change from SPDs

Description

Function for computing rates of change between abutting user-defined time-blocks.

Usage

spd2rc(
  spd,
  breaks = NULL,
  backsight = NULL,
  changexpr = expression((t1/t0)^(1/d) - 1)
)

Arguments

spd

Summed Probability Distribution obtained using the spd function.

breaks

A vector giving the breakpoints between the time-blocks.

backsight

A single numeric value defining the distance in time between the focal year and the backsight year for computing the rate of change.

changexpr

An expression defining how the rate of change is calculated, where t1 is the summed probability for a focal block or year, t0 is the summed probability for previous block or backsight year, and d is the duration of the block or the length of the backsight. Default is a geometric growth rate (i.e expression((t1/t0)^(1/d)-1)).

Details

When the argument breaks is supplied the function aggregates the summed probability within each time-block and compared them across abutting blocks using the expression defined by changexpr. When the argument backsight is provided he expression is based on the comparison between the summed probability of each year and the associated backsight year.

Value

An object of class spdRC.

Examples

## Not run: 
data(emedyd)
caldates <- calibrate(x=emedyd$CRA, errors=emedyd$Error, normalised=FALSE, calMatrix=TRUE)
bins <- binPrep(sites=emedyd$SiteName, ages=emedyd$CRA, h=50)
emedyd.spd <- spd(caldates,bins,timeRange=c(16000,9000),runm=100)
emedyd.gg <- spd2rc(emedyd.spd,breaks=seq(16000,9000,-1000))
emedyd.gg2 <- spd2rc(emedyd.spd,backsight=10)
plot(emedyd.gg)
plot(emedyd.gg2)

## End(Not run)

rcarbon documentation built on Aug. 24, 2023, 5:11 p.m.