pretreatment: Calculate re-sampled particles' accumulation rates for...

View source: R/pretreatment.R

pretreatmentR Documentation

Calculate re-sampled particles' accumulation rates for sediment records

Description

This is the R version of the CharPretreatment.m function, which was originally developed by Philip Higuera for "CharAnalysis" (see https://github.com/phiguera/CharAnalysis/tree/master). It has been translated from the Matlab-coded CharPretreatment.m function by Olivier Blarquez and was included in the paleofire v1.2.4 R package (https://github.com/oblarquez/paleofire). The function is now included in the tapas R package because the paleofire R package is currently not being updated.

Usage

pretreatment(
  params,
  serie,
  Int = TRUE,
  first = NULL,
  last = NULL,
  yrInterp = NULL
)

Arguments

params

A matrix with the following columns: CmTop, CmBot, AgeTop, AgeBot, Volume, in the same order.

serie

Numerical. A record to be transformed in accumulation rates. Could be the number, the area, or the volume of particles in samples.

Int

Logical. Specifies whether the function interpolates missing values. By default Int = TRUE. Missing values are identified when the value of serie is equal to -999 or NA, or when the sample Volume = 0.

first, last

Date of the first, last sample for accumulation rate calculation, if NULL first, last are automatically specified as the the minimum and maximum ages of the record respectively.

yrInterp

Temporal resolution of the interpolated accumulation rates, if NULL, yrInterp is automatically specified as the median resolution of the record.

Details

Note: The code has been modified to calculate sediment-accumulation rates in a different way: now the code uses explicit sample thicknesses and sample-deposition times rather than diff(depth) and diff(age).

Value

Returns an object of the class "proxy_ar_i" including:

cmI

interpolated depths

ybpI

interpolated ages

accI

accumulation rates

Author(s)

Olivier Blarquez

Examples

## Not run: 
# Load raw charcoal data:
co <- tapas::co_char_data
c <- co[, 6] # charcoal counts
p <- co[, 1:5] # CmTop, CmBot, AgeTop, AgeBot, Volume

# Calculate charcoal accumulation rate (CHAR, as pieces cm-2 yr-1)
co_CHAR <- tapas::pretreatment(params = p, serie = c, Int = TRUE)
tapas::plot_ar_i(co_CHAR)

## End(Not run)

wfinsinger/tapas documentation built on Aug. 22, 2024, 4:28 a.m.