smooth {gcxgclab}R Documentation

Smoothing

Description

smooth performs smoothing of the intensity values.

Usage

smooth(data, lambda = 20, dir = "XY")

Arguments

data

a list object. Data extracted from a cdf file, ideally the output from extract_data().

lambda

a float object. A number (parameter in Whittaker smoothing), suggested between 0 to 10^4. Small lambda is very little smoothing, large lambda is very smooth. Default is lambda = 20.

dir

a string object. Either "X", "Y", or "XY" to indicate direction of smoothing. "XY" indicates smoothing in both X (horizontal) and Y (vertical) directions. Default "XY".

Details

This function performs smoothing of the intensity values using Whittaker smoothing algorithm whit1 from the ptw package (Eilers 2003).

Value

A data.frame object. A list of two data frames. A TIC data frame and an MS data frame.

References

Eilers PH (2003). “A perfect smoother.” Analytical Chemistry, 75, 3631-3636.

Examples

file <- system.file("extdata","sample1.cdf",package="gcxgclab")
frame <- extract_data(file,mod_t=.5)
sm_frame <- smooth(frame, lambda=10)
plot_chr(sm_frame, title='Smoothed')


[Package gcxgclab version 1.0.1 Index]