Learn R Programming

rchemo (version 0.1-3)

interpl: Resampling of spectra by interpolation methods

Description

Resampling of signals by interpolation methods, including linear, spline, and cubic interpolation.

The function uses function interp1 of package signal available on the CRAN.

Usage

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

Value

A matrix of the interpolated signals.

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".

Examples

Run this code

data(cassav)

X <- cassav$Xtest
headm(X)

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

Run the code above in your browser using DataLab