Learn R Programming

rice (version 1.1.1)

push.normal: Add a normal distribution to a calibrated date

Description

Push a date to younger or older ages by adding (or subtracting) a normal distribution (e.g. if a bone is assumed to have a lag or in-built age)

Usage

push.normal(
  y,
  er,
  mean,
  sdev,
  add = TRUE,
  n = 1e+06,
  prob = 0.95,
  cc = 1,
  postbomb = FALSE,
  deltaR = 0,
  deltaSTD = 0,
  thiscurve = NULL,
  cc.dir = NULL,
  normal = TRUE,
  t.a = 3,
  t.b = 4,
  BCAD = FALSE,
  cal.lim = c(),
  calib.col = rgb(0, 0, 0, 0.25),
  pushed.col = rgb(0, 0, 1, 0.4),
  heights = 0.3,
  inset = TRUE,
  inset.col = "darkgreen",
  inset.loc = c(0.6, 0.97, 0.6, 0.97),
  inset.mar = c(3, 0.5, 0.5, 0.5),
  inset.mgp = c(2, 1, 0)
)

Value

The resulting calibrated distribution and its hpd ranges, together with a plot of the pushed date with the normal distribution (and whether it is added or subtracted) as inset

Arguments

y

The radiocarbon age.

er

The error of the radiocarbon age.

mean

The mean of the normal or gamma distribution.

sdev

The standard deviation of the normal distribution.

add

The distribution can be added or subtracted. Adding results in ages being pushed to younger age distributions, and subtracting to older ones.

n

The amount of random values to sample (from both the calibrated distribution and the gamma/normal distribution) to calculate the push. Defaults to n=1e6.

prob

The probability for the hpd ranges. Defaults to prob=0.95.

cc

Calibration curve to use. Defaults to IntCal20 (cc=1).

postbomb

Whether or not to use a postbomb curve. Required for negative radiocarbon ages. Defaults to postbomb=FALSE.

deltaR

Age offset (e.g. for marine samples).

deltaSTD

Uncertainty of the age offset (1 standard deviation).

thiscurve

As an alternative to providing cc and/or postbomb, the data of a specific curve can be provided (3 columns: cal BP, C14 age, error).

cc.dir

Directory of the calibration curves. Defaults to where the package's files are stored (system.file), but can be set to, e.g., cc.dir="curves".

normal

Use the normal distribution to calibrate dates (default TRUE). The alternative is to use the t model (Christen and Perez 2016).

t.a

Value a of the t distribution (defaults to 3).

t.b

Value b of the t distribution (defaults to 4).

BCAD

Which calendar scale to use. Defaults to cal BP, BCAD=FALSE.

cal.lim

Calendar axis limits. Calculated automatically by default.

calib.col

Colour of the calibrated distribution (defaults to semi-transparent light grey).

pushed.col

Colour of the pushed distribution (defaults to semi-transparent blue).

heights

Heights of the calibrated and 'pushed' distributions. Defaults to 0.3 of the device's height.

inset

Whether or not to plot an inset graph showing the shape of the normal/gamma distribution.

inset.col

Colour of the normal/gamma distribution.

inset.loc

Location of the inset graph.

inset.mar

Margins of the inset graph.

inset.mgp

Margin lines for the inset graph.

Details

n random values will be sampled from the calibrated distribution, and a similar amount will be sampled from the normal distribution. The sampled values will then be added to or subtracted from each other to push the date to younger or older ages.

Examples

Run this code
  push.normal(250, 25, 50, 10)

Run the code above in your browser using DataLab