SpectraDataFrame | R Documentation |
Constructor for the SpectraDataFrame class. Creates a SpectraDataFrame object, either from scratch, or from an existing Spectra object.
SpectraDataFrame(
...,
wl = numeric(),
nir = matrix(),
id = as.character(NA),
units = "nm",
data = data.frame()
)
... |
an object inheriting from |
wl |
a numeric vector giving the wavelengths at with the spectra have been measured |
nir |
a |
id |
a vector giving the unique id of each sample in the collection |
units |
a character giving the unit in which the wavelengths values are expressed |
data |
object of class |
a new "SpectraDataFrame"
object
Pierre Roudier pierre.roudier@gmail.com
spectra
, wl
,
Spectra-class
# Creating a SpectraDataFrame object from scratch
my.wl <- 350:2500
my.id <- c("A", "B")
my.nir <- matrix(runif(2*length(my.wl)), nrow=2)
my.data <- data.frame(foo = runif(2), bar = LETTERS[1:2])
my.sdf <- SpectraDataFrame(wl = my.wl, nir = my.nir, id = my.id, data = my.data)
# Creating a SpectraDataFrame object from an existing Spectra object
my.s <- Spectra(wl = my.wl, nir = my.nir, id = my.id)
my.sdf <- SpectraDataFrame(my.s, data = my.data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.