Learn R Programming

hyperSpec (version 0.98-20150304)

spc.smooth.spline: Spectral smoothing by splines

Description

Smoothing splines

Usage

spc.smooth.spline(spc, newx = wl(spc), ...)

Arguments

spc
hyperSpec object
newx
wavelengh axis to interpolate on
...
further parameters handed to smooth.spline

Value

hyperSpec object containing smoothed spectra

Details

Spectral smoothing by splines

See Also

spc.loess

smooth.spline

Examples

Run this code
p <- paracetamol [,,2200 ~ max]
plot (p, col = "gray")
smooth <- spc.smooth.spline (p [,, c (2200 ~ 2400, 2500 ~ 2825, 3150 ~ max)],
                             wl (paracetamol [,, 2200 ~ max]),
                             df = 4, spar = 1)
plot (smooth, col = "red", add = TRUE)

plot (p - smooth)

Run the code above in your browser using DataLab