stat_X: Analyse raw ion count data

View source: R/analyse_IC.R

stat_XR Documentation

Analyse raw ion count data

Description

stat_X function for descriptive and predictive statistics on single ion precision. stat_R function for descriptive and predictive statistics on isotope ratios (R) precision with appropriate error propagation.

Usage

stat_X(
  .IC,
  ...,
  .X = NULL,
  .N = NULL,
  .species = NULL,
  .t = NULL,
  .stat = point::names_stat_X$name,
  .label = "none",
  .meta = FALSE,
  .output = "sum"
)

stat_R(
  .IC,
  .ion1,
  .ion2,
  ...,
  .nest = NULL,
  .X = NULL,
  .N = NULL,
  .species = NULL,
  .t = NULL,
  .stat = point::names_stat_R$name,
  .label = "none",
  .output = "sum",
  .zero = FALSE
)

Arguments

.IC

A tibble containing processed ion count data.

...

Variables for grouping.

.X

A variable constituting the ion count rate (defaults to variables generated with read_IC().)

.N

A variable constituting the ion counts (defaults to variables generated with read_IC().).

.species

A variable constituting the species analysed (defaults to variables generated with read_IC().).

.t

A variable constituting the time of the analyses (defaults to variables generated with read_IC().).

.stat

Select statistics (e.g. c("M", "RS"), see the tables point::names_stat_X and point::names_stat_R for the full selection of statistics available (default uses all statistic transformations).

.label

A character string indicating whether variable names are latex ("latex") or webtex ("webtex") compatible. Will be extended in the future default = NULL.

.meta

Logical whether to preserve the metadata as an attribute (defaults to TRUE).

.output

A character string for output as summary statistics ("sum"); statistics only ("stat"); and statistics with the original data ("complete") default = "sum".

.ion1

A character string constituting the heavy isotope ("13C").

.ion2

A character string constituting the light isotope ("12C").

.nest

A variable hat identifies a series of analyses to calculate external precision.

.zero

A character string that determines whether analyses with zero count measurements will be removed from the calculations.

Details

These functions are a convenient wrapper to calculate the statistics pertaining to the precision of pulsed ion count data (e.g. secondary ion mass spectrometry). The statistics can either be calculated for single ions or isotope ratios, and include observed and predicted (Poisson) statistics. Calculations for isotope ratios include proper error propagation. For more information on the usage as well as the mathematics behind these functions see vignette("IC-precision", package = "point").

Value

A tibble::tibble containing descriptive and predictive statistics for ion counts and isotope ratios. The naming convention depends on the argument latex; if set to FALSE, variable names concerning statistics will consist of an abbreviation pasted together with the input variable names of Xt.

Examples

# Use point_example() to access the examples bundled with this package

# raw data containing 13C and 12C counts on carbonate
tb_rw <- read_IC(point_example("2018-01-19-GLENDON"), meta = TRUE)

# Processing raw ion count data
tb_pr <- cor_IC(tb_rw)

# Single ion descriptive an predictive statistics for all measured ions
stat_X(tb_pr, file.nm)

# Descriptive an predictive statistics for 13C/12C ratios
stat_R(tb_pr, "13C", "12C", file.nm, .zero = TRUE)

# Descriptive an predictive statistics for 13C/12C ratios (external)
stat_R(tb_pr, "13C", "12C", sample.nm, file.nm, .nest = file.nm,
       .zero = TRUE)

MartinSchobben/point documentation built on May 22, 2022, 7:15 a.m.