msSmoothApprox {msProcess} | R Documentation |
Estimates the baseline of a spectrum as a linear or constant interpolation of the local minima of a spectrum.
msSmoothApprox(x, y, method="linear", rule=2, f=0.5, index=rep(TRUE, length(x)), process="msSmoothApprox")
x |
A numeric vector representing the m/z values of a spectrum. |
y |
A numeric vector representing the intensity values of the spectrum corresponding to the
specified m/z values. |
f |
A numeric scalar used when method="constant" ,
which determines a blend of the left and right side y values.
e.g., suppose we want an interpolated value between x1 and x2
(with corresponding y values y1 and y2).
Then the interpolated value is (1-f)*y1+f*y2.
Thus, if f=0, the left y-value is used, if f=1, the right y-value,
and if f is between 0 and 1, an intermediate value is used.
Default: 0.5. |
index |
A logical vector indicating the local minima to be used
to approximate the baseline. Default: rep(TRUE, length(x)) . |
method |
A character string describing the method to be used in approximating the baseline.
This must be either "linear" or "constant" . Default: "linear" . |
process |
A character string denoting the name of the
process to register with the (embedded) event history object of the input
after processing the input data.
Default: "msSmoothApprox" . |
rule |
An integer (either 2 or 3) describing the rule to be used for values
that are outside the range of the minima of x .
If rule=2 , the y values corresponding to the extreme x values will be used.
If rule=3 , linear extrapolation is used.
Default: 2. |
A numeric vector representing the estimated piece-wise linear baseline.
msSmoothKsmooth
, msSmoothLoess
, msSmoothMean
, msSmoothMonotone
, msSmoothSpline
, msSmoothSupsmu
.