wavelength {visa} | R Documentation |
Retrieve Wavelength Information from Spectra Objects
Description
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.
Usage
wavelength(object, ...)
## S4 method for signature 'Spectra'
wavelength(object, ...)
## S4 method for signature 'data.frame'
wavelength(object, ...)
## S4 method for signature 'matrix'
wavelength(object, ...)
Arguments
object |
An object containing spectra data. This can be an S4 object of class |
... |
Additional arguments for future extensions (currently not used). |
Details
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.
Value
A numeric vector representing the wavelength information extracted from the object.
Examples
## 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)
[Package visa version 1.0.0 Index]