smooth.spectra: Smooth spectra

View source: R/transform_spectra.R

smooth.spectraR Documentation

Smooth spectra

Description

smooth runs each spectrum by a smoothing and returns the spectra

Usage

## S3 method for class 'spectra'
smooth(x, method = "spline", ...)

Arguments

x

spectra object. bands must be strictly increasing

method

Choose smoothing method: "spline" (default) or "moving_average"

...

additional parameters passed to smooth.spline or parameters 'n' and 'save_bands_to_meta' for the moving average smoothing.

Value

a spectra object of with smoothed spectra

Author(s)

Jose Eduardo Meireles

Examples

library(spectrolab)

spec = as_spectra(spec_matrix_example, name_idx = 1)
spec = smooth(spec, parallel = FALSE)

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