as.rspec {pavo} | R Documentation |
Convert data to an rspec object
Description
Converts data frames or matrices containing spectral data to rspec
object
Usage
as.rspec(
object,
whichwl = NULL,
interp = TRUE,
lim = NULL,
exceed.range = TRUE
)
is.rspec(object)
Arguments
object |
(required) a data frame or matrix containing spectra to process. |
whichwl |
a numeric or character vector specifying which column contains
wavelengths. If |
interp |
whether to interpolate wavelengths in 1-nm bins (defaults to
|
lim |
vector specifying wavelength range to interpolate over (e.g.
|
exceed.range |
logical. Should data be interpolated to the limits
specified by |
Value
an object of class rspec
for use in further pavo
functions
a logical value indicating whether the object is of class rspec
Author(s)
Chad Eliason cme16@zips.uakron.edu
Examples
# Generate some fake reflectance data
fakedat <- data.frame(wl = 300:700, refl1 = rnorm(401), refl2 = rnorm(401))
head(fakedat)
# Determine if is rspec object
is.rspec(fakedat)
# Convert to rspec object
fakedat2 <- as.rspec(fakedat)
is.rspec(fakedat2)
head(fakedat2)