subsetSpectra: Function to subset regions of spectra.

Description Usage Arguments Value Author(s) Examples

View source: R/subsetSpectra.R

Description

This function accepts an object containing spectra and subsets it to a specified region(s).

Usage

1

Arguments

spec

An object of class spectra.matrix to be subset.

ranges

A two column matrix, each row contains max and min range values. Alternatively, a list, where each element is a vector of length 2, specifying the range (max/min) of a spectral region to select. Should be in the same units as your spectra (e.g., wavenumbers).

Value

Returns an object of class spectra.list.

Author(s)

Daniel M Griffith

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
data(shootout)
s_mat <- matrix(data = c(2000,1750,1000,500), nrow = 2, ncol = 2, byrow = T)
sub_data <- subsetSpectra(spec = shootout_scans, ranges = s_mat)

par(mfrow=c(1,2))
plot(shootout_scans)
plot(sub_data)

## End(Not run)

griffithdan/plantspec documentation built on May 17, 2019, 8:37 a.m.