correct_baseline: Linear baseline correction with left and right endpoints

View source: R/correct_baseline.R

correct_baselineR Documentation

Linear baseline correction with left and right endpoints

Description

Linear baseline correction with left and right endpoints

Usage

correct_baseline(
  x,
  left = 10,
  right = 35,
  window = 0.2,
  group_vars = c("date", "sample", "param"),
  x_var = "time",
  y_var = "conc"
)

Arguments

x

A tibble of the type returned by load_icp().

left

The left endpoint.

right

The right endpoint.

window

The fitting window at each endpoint.

group_vars

Grouping variables for input to dplyr::group_by(). Set to NULL when there are no grouping variables.

x_var

Name of x variable.

y_var

Name of y variable.

Value

A tibble of the type returned by load_icp(), with the column 'conc' modified by a linear baseline correction.

Examples

data <- data.frame(
  date = as.Date("2021-01-01"),
  sample = "a",
  param = "56Fe",
  time = seq(0, 30, by = .1),
  conc = runif(301, 0, 1)
)
data$conc <- data$conc + data$time
correct_baseline(data, left = .2, right = 29.8)

bentrueman/fffprocessr documentation built on June 23, 2024, 1:23 a.m.