as.hyperSpec | R Documentation |
These functions are shortcuts to convert other objects into hypeSpec objects.
as.hyperSpec(X, ...)
## S4 method for signature 'matrix'
as.hyperSpec(X, wl = guess.wavelength(colnames(X)), ...)
## S4 method for signature 'data.frame'
as.hyperSpec(
X,
spc = NULL,
wl = guess.wavelength(spc),
labels = attr(X, "labels"),
...
)
X |
the object to convert. A matrix is assumed to contain the spectra matrix, a data.frame is assumed to contain extra data. |
... |
additional parameters that should be handed over to |
wl |
wavelength vector. Defaults to guessing from the column names in |
spc |
spectra matrix |
labels |
list with labels |
hyperSpec object
Note that the behaviour of as.hyperSpec (X)
was changed: it now assumes X
to be extra data,
and returns a hyperSpec object with 0 wavelengths. To get the old behaviour
initialize
tmp <- data.frame(flu [[,, 400 ~ 410]])
(wl <- colnames (tmp))
guess.wavelength (wl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.