Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.hyperSpec

as.hyperSpec: convenience conversion functions


Description

These functions are shortcuts to convert other objects into hypeSpec objects.

Usage

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"),
  ...
)

Arguments

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 new ("hyperSpec") (initialize)

wl

wavelength vector. Defaults to guessing from the column names in X

spc

spectra matrix

labels

list with labels

Value

hyperSpec object

Note

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

See Also

Examples

tmp <- data.frame(flu [[,, 400 ~ 410]])
(wl <- colnames (tmp))
guess.wavelength (wl)

hyperSpec

Work with Hyperspectral Data, i.e. Spectra + Meta Information (Spatial, Time, Concentration, ...)

v0.100.0
GPL (>= 3)
Authors
Claudia Beleites [aut, cre, dtc] (<https://orcid.org/0000-0003-1626-154X>), Valter Sergo [aut], Alois Bonifacio [ctb, dtc], Marcel Dahms [ctb], Björn Egert [ctb], Simon Fuller [ctb], Vilmantas Gegzna [ctb], Rustam Guliev [ctb], Bryan A. Hanson [ctb], Michael Hermes [ctb], Martin Kammer [dtc], Roman Kiselev [ctb], Sebastian Mellor [ctb]
Initial release
2021-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.