resample: Resample spectra

View source: R/transform_spectra.R

resampleR Documentation

Resample spectra

Description

resample returns spectra resampled to new bands using spline smoothing. Possible to increase or decrease the spectral resolution.

Usage

resample(x, new_bands, ...)

## S3 method for class 'spectra'
resample(x, new_bands, ...)

Arguments

x

spectra object. bands must be strictly increasing

new_bands

numeric vector of bands to sample from spectra

...

additional parameters passed to the smooth.spline function.

Details

resample doesn't predict values for bands outside of the original range.

Value

spectra object with resampled spectra

Methods (by class)

  • resample(spectra): Resample spectra

Author(s)

Jose Eduardo Meireles

Examples

library(spectrolab)
spec = as_spectra(spec_matrix_example, name_idx = 1)
spec = resample(spec, new_bands = seq(400, 2400, 0.5), parallel = FALSE)

spectrolab documentation built on Feb. 16, 2023, 10:27 p.m.