knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures"
)
# Please put your title here to include it in the file below.
Title <- "Title of your paper goes here"

elco

Lifecycle: experimental

Overview

'elco' provides functions to handle and (rudimentary) analyze element content data and isotope signature data. Features are:

  1. Import of XRF and IRMS data as they can be exported from X-ray fluorescence spectrometers (Rigaku ZSX Primus II) and EA-IRMS devices (HEKATech's Eurovector EA3000 coupled with Nu Instruments Nu Horizon).

  2. Graphical display for easy data checking.

  3. Correction of IRMS-measured element content data and isotope signatures in cases of a mismatch in the signal areas between samples and standards.

  4. Unit conversion of element content data (e.g. g/g to mol).

  5. Computation of the nominal oxidation state of carbon (NOSC), oxidative ratio (OR), and degree of unsaturation (DU) [@Worrall.2016b; @Masiello.2008].

knitr::include_graphics("man/figures/elco-features.svg")

How to install

elco can be installed from GitHub:

remotes::install_github("henningte/elco")

How to use

Here is a short overview on elco general-purpose capabilities (handling element content ratios). Examples of how to import and correct data are not described here, but in the vignettes.

library(elco)

# load other required packages
library(dplyr)
library(quantities)
library(magrittr)

First, we have a short look at the sample data and its structure:

d <- elco::chno
d

Contents for one element are stored in a numeric vector. Measurement units and errors are tracked using the quantities package. elco adds to this an identifier for the element:

# show exemplary structure for the C content
d$C

New elco objects can be defined with elco_new_elco (by providing a quantities object and an element symbol). For instance, this specifies two new C content values:

x <- 
  quantities::set_quantities(c(0.3, 0.43), unit = "g/g", errors = c(0.2, 0.12)) %>%
  elco_new_elco(el_symbol = "C")
x

elco supports unit conversion (using the functions of the quantities package and molar masses from PeriodicTable):

# g/g to mol
x %>% 
  elco_elco_convert(to = "mol", 
                    sample_mass = quantities::set_quantities(1, unit = "g", errors = 0))

# g/g to mg
x %>% 
  elco_elco_convert(to = "mg", 
                    sample_mass = quantities::set_quantities(1, unit = "g", errors = 0))

... even with complete data.frames!

# g/g to mol
d %>% elco_elco_convert_df(to = "mol", sample_mass = d$sample_mass)

elco helps computing element ratios:

d %>%
  elco_elco_convert_df(to = "mol", sample_mass = d$sample_mass) %>%
  dplyr::mutate(cn_molar = C/N,
                ch_molar = C/H,
                co_molar = C/O)

Finally, elco provides functions to compute the nominal oxidation state of carbon (NOSC), oxidative ratio (OR), and degree of unsaturation (DU) [@Worrall.2016b; @Masiello.2008]

d <- 
  d %>%
  elco::elco_elco_convert_df(to = "mol", sample_mass = d$sample_mass) %>%
  dplyr::mutate(
    nosc = elco_nosc(C, H, N, O),
    or = elco_or(C, H, N, O),
    du = elco_du(C, H, N)
  )

Further information can be found in the vignettes:

How to cite

Please cite this compendium as:

Teickner, H. and Knorr, K.-H., (r format(Sys.Date(), "%Y")). elco: Handling data on chemical element contents and isotope signatures.. Accessed r format(Sys.Date(), "%d %b %Y"). Online at https://github.com/henningte/elco

Acknowledgments

We thank @Gaka.2019 for the provision of test data.

Licenses

Text and figures : CC-BY-4.0

Code : See the DESCRIPTION file

Data : CC-BY-SA-4.0. All external data (files "xrf1.csv", "xrf2.csv", "irms1.csv", and "irms2.csv") for elco were provided by @Gaka.2019. elco::irms_standards was collected from different data sources [@Coplen.2006; @IVAAnalysentechnikGmbHuCoKGt.2016] and own measurements (see the documentation for details). elco::chno was created by the package's authors.

Contributions

We welcome contributions from everyone. Before you get started, please see our contributor guidelines. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Sources

All data for this package are from @Gaka.2019.



henningte/elco documentation built on May 21, 2022, 6:56 p.m.