refTrans {assignR}R Documentation

Transform reference scale of data

Description

This function conducts transformations to convert isotope measurements between reference scales.

Usage

refTrans(samples, marker = "d2H", ref_scale = "VSMOW_H", niter = 5000)

Arguments

samples

data.frame. Must include a field with data to be transformed, analytical reproducibility of sample data (1 standard deviation), and original reference scale for calibration of data. These fields must be named marker, marker.sd, and marker_cal, respectively, where marker is “d2H” or “d18O”. Values for the cal field should correspond to Calibration codes found in stds tables hstds and ostds.

marker

character string. Column name for isotopic data to be extracted, either “d2H” or “d18O”.

ref_scale

character string. Text identifier for reference scale to which all isotope values will be transformed. See stds.

niter

integer. Number of random samples used to propagate uncertainty in calibration hierarchy transformations.

Value

Returns an object of class “refTrans”.

data

data.frame. Formatted identically to input object samples, with values for the data and data uncertainty fields replaced with transformed values.

chains

list. Each item is a character string vector containing the hierarchy of calibrations used in the transformation for a set of selected samples. See stds.

References

Magozzi, S. et al. (in press) Calibration chain transformation to improve the comparability of organic hydrogen and oxygen isotope data. Methods in Ecology and Evolution

Examples

# Some fake sample data
s = data.frame("d2H" = seq(-100, -10, by=10), "d2H.sd" = rep(2), "d2H_cal" = rep("OldUT_H_1"))

# Transform to VSMOW-SLAP scale using default arguments
d1 = refTrans(s)

# Transformed values
d1$data$d2H

# error - target scale not valid for marker
## Not run: d2 = refTrans(s, ref_scale = "VSMOW_O")


[Package assignR version 2.4.1 Index]