R interface for working with isotopic data (abundances, ratios, delta values, etc.).
This package provides several isotopic data types that can be initialized
by calling the respective ratio
, abundance
,
delta
, fractionation_factor
and intensity
functions.
Each data type
has additional attributes (such as name of the major isotope for all data
types, reference ratio for delta
values, notation for delta
and fractionation_factor
, unit for intensity
)
and these are described in detail in the help for each function. The attributes of any
existing isotope data object can be modified easily by calling set_attrib
Each data type can be initialized as a single vector of isotopic data or an entire system
of isotope values for the same element (e.g. all oxygen or all sulfur isotopes). To
intialize an isotope system, simply pass multiple named data vectors with the same number
of data points to the initialization functions (please see examples
for details). Isotope systems are returned as a data.frame
with all the different
components of the system
as separate columns. This object can be treated and manipulated just like a
regular R data.frame. The column headers are named after the individual named
data vectors (e.g. ratio(`34S` = 0.1, `33S` = 0.2)
will produce a data.frame
with columns 34S
and 33S
) - careful if using
names like '12C' that start with a number, they are not syntactically valid
variable names in R and must be back quoted as `34S`
. Isotope data objects in
an isotope system that are not named generate columns named iso, iso.1, iso.2, ...
.
Isotope data objects (both single vectors and isotope systems) can then be converted
to different data types using the respective to_ratio
, to_abundance
,
to_delta
functions. Notations can also be changed using switch_notation
Global options for isotopia can be set using set_iso_opts
and
standard reference ratios can be registered using register_standard
# these examples are for initializing isotope ratio objects but apply equally to other data types ratio(0.1) # single value#> An isotope value object of type 'Ratio value': R #> [1] 0.1#> An isotope value object of type 'Ratio value': R #> [1] 0.1 0.2 0.3#> An isotope value object of type 'Ratio value': R 13C/? #> [1] 0.1 0.2 0.3#> An isotope system object of type 'Ratios' with R 33S/32S, R 34S/32S #> 33S 34S #> 1 0.1 0.2 #> 2 0.2 0.4 #> 3 0.3 0.6