interpl {rchemo}R Documentation

Resampling of spectra by interpolation methods

Description

Resampling of signals by interpolation methods, including linear, spline, and cubic interpolation. The function uses interp1 of package signal available on the CRAN.

Usage


interpl(X, w, meth = "cubic", ...)

Arguments

X

X-data (n x p). For the interpolation, the column names of X are taken as numeric values, w0. If they are not numeric or missing, they are automatically set to w0 = 1:p.

w

A vector of the values where to interpolate (typically within the range of w0).

meth

The method of interpolation. See interp1.

...

Optional arguments to pass in function splinefun if meth = "spline".

Value

A matrix of the interpolated signals.

Examples


data(cassav)

X <- cassav$Xtest
headm(X)

w <- seq(500, 2400, length = 10)
zX <- interpl(X, w, meth = "spline")
headm(zX)
plotsp(zX)


[Package rchemo version 0.1-2 Index]