This function evaluates drift and can correct for it (use parameter correct = TRUE). Note that it corrects drift based on the 45/44 and 46/44 ratio, although one could certainly debate the merits of doing the O17 correction first. Although designed to be specific for d45 and d46, it can be used on any two columns really, only note that the new columns are currently always called d45.drift and d46.drift

evaluate_drift(
  data,
  d45,
  d46,
  group = name,
  correct = FALSE,
  correct_with = category %in% c("USGS-34", "IAEA-NO3", "N2O"),
  plot = TRUE,
  quiet = FALSE,
  method = "lm",
  span = 0.75,
  ...
)

Arguments

data

the data frame, must be from a single run because this should really be evaluated for individual runs

d45

the name of the d45 column (the direct name, not in parantheses)

d46

the name of the d46 column (the direct name, not in parantheses)

group

expression for what to group by in order to normalize properly this is also used for color coding the data points in the generated plot (if plot = TRUE)

correct

whether to correct for drift or not (default is FALSE)

correct_with

expression for what all to include in the correction

plot

whether to output the drift plots [default is FALSE]

method

which method to use for drift correction, common approaches are linear models (lm) and local polynomial regression fitting (loess)

span

degree of smoothing for the loess (if this method is used)

...

additional parameters for the fitting method

Value

introduces the new columns d45.drift and d46.drift + parameter column p.drift