Linear Baseline Estimation
Arguments
- x, y
A
numeric
vector. Ify
is missing, an attempt is made to interpretx
in a suitable way (seegrDevices::xy.coords()
).- ...
Currently not used.
- points
A
numeric
vector specifying the data points to be used in the fitting process (inx
unit).
Value
Returns a list
with two components x
and y
.
See also
Other baseline estimation methods:
baseline_asls()
,
baseline_peakfilling()
,
baseline_polynomial()
,
baseline_rollingball()
,
baseline_rubberband()
,
baseline_snip()
Examples
## X-ray diffraction
data("XRD")
## Plot spectrum
plot(XRD, type = "l", xlab = expression(2*theta), ylab = "Count")
## Linear baseline
baseline <- baseline_linear(XRD, points = c(25, 34))
plot(XRD, type = "l", xlab = expression(2*theta), ylab = "Count")
lines(baseline, type = "l", col = "red")
## Correct baseline
XRD$count <- XRD$count - baseline$y
plot(XRD, type = "l", xlab = expression(2*theta), ylab = "Count")