resample {prospectr} | R Documentation |
Resample a data matrix
, data.frame
or
vector
to new coordinates (e.g. band positions)
using spline or linear interpolation. This function is a
simple wrapper around approx
and
splinefun
in base.
resample(X,wav,new.wav,interpol)
X |
numeric |
wav |
a numeric vector giving the original band positions |
new.wav |
a numeric vector giving the new band positions |
interpol |
interpolation method: 'linear' or 'spline' |
a matrix
or vector
with resampled values
Antoine Stevens
data(NIRsoil) wav <- as.numeric(colnames(NIRsoil$spc)) spc <- 1/10^NIRsoil$spc # conversion to reflectance resampled <- resample(spc,wav,1100:2498) # increase spectral resolution by 2 dim(spc);dim(resampled)