View source: R/elco_irms_correct_elements.R
elco_irms_correct_elements | R Documentation |
elco_irms_correct_elements
is a heuristic function to correct measured element contents of samples
during IRMS analysis. Correction can be performed for either C or N and, if multiple
files are batch-processed, using either standards from all files or only from the file where the respective
sample is located in.
The procedure is as follows:
For each measured standard, assign the known reference element mass content from
irms_standards
.
Use the information on the mass of the measured samples and the assigned element mass content values to compute the respective absolute known element content [mg].
For all measured standards, compute a linear regression model that predicts the absolute element content in dependency of the respective signal area.
For each sample, use the regression model and the respective measured signal area to compute the absolute element content.
Divide the absolute predicted element contents by the samples' masses [mg] to get the mass fraction of the element.
(Optionally): create plot: (1) showing uncorrected and corrected element mass fractions for all measured standards and samples. This plot may be used as a visual check of the heuristic correction procedure and shows how the values for all samples are corrected. In addition, for each fitted regression model, the measured absolute element masses are plotted in dependency of the signal areas with the regression line. These plot can be used to assess if the regression model captures well the measured data for the standards.
elco_irms_correct_elements( x, element = "C", standards = irms_standards$standard_name, by_file = TRUE, plotit = FALSE )
x |
An object of class |
element |
A character value representing the chemical element for which to correct the mass fraction values. This must be one of "C" or "N". |
standards |
A character vale specifying standards to use for computing the regression equation.
This must be one of |
by_file |
A logical value indicating if medians of standards are computed across different files
as indicated by |
plotit |
A logical value indicating if a plot for checking should be printed ( |
x
with corrected element content.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.