wavelength | R Documentation |
This function extracts the wavelength information from various representations of spectra.
It supports the S4 class Spectra
, as well as data.frame and matrix representations.
wavelength(object, ...)
## S4 method for signature 'Spectra'
wavelength(object, ...)
## S4 method for signature 'data.frame'
wavelength(object, ...)
## S4 method for signature 'matrix'
wavelength(object, ...)
object |
An object containing spectra data. This can be an S4 object of class |
... |
Additional arguments for future extensions (currently not used). |
For an object of class Spectra
, the method returns the value stored in the wavelength
slot. For a data.frame or matrix, it extracts numeric values from the column names (by removing
non-digit characters) of the spectra data.
A numeric vector representing the wavelength information extracted from the object.
## Not run:
library(visa)
# For an S4 Spectra object
wavelengths <- wavelength(NSpec.Lib)
# For spectra stored in a data.frame
wavelengths <- wavelength(NSpec.DF)
# For spectra stored in a matrix
wavelengths <- wavelength(spectra_matrix)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.