as.hyperSpec: convenience conversion functions
These functions are shortcuts to convert other objects into
as.hyperSpec(X, ...) # S4 method for matrix as.hyperSpec(X, wl = NULL, ...) # S4 method for data.frame as.hyperSpec(X, spc = NULL, wl = NULL, labels = attr(X, "labels"), ...) # S4 method for hyperSpec as.hyperSpec(X)
the object to convert. If
matrix, it is assumed to contain the spectra matrix,
data.frame, it is assumed to contain extra data.
additional parameters that should be handed over to
wavelength vector. Defaults to guessing from the column names in
list with labels.
Note that the behaviour of
as.hyperSpec(X) was changed when
X is a
data.frame: it now assumes
X to be extra data, and returns a
object with 0 wavelengths. To get the old behaviour, use