Handling spectra
Returning and setting spectra in Speclib
## S4 method for signature 'Speclib' spectra(object, i, j, ...) ## S4 replacement method for signature 'Speclib,data.frame' spectra(object) <- value ## S4 replacement method for signature 'Speclib,matrix' spectra(object) <- value ## S4 replacement method for signature 'Speclib,numeric' spectra(object) <- value ## S4 replacement method for signature 'Speclib,RasterBrick' spectra(object) <- value
object |
Object of class |
i |
Index of spectra to return. If missing all spectra are returned. |
j |
Index of bands to return. If missing all bands are returned. |
... |
Passed to internal function. Currently only one parameter is accepted: |
value |
Matrix or RasterBrick-object containing spectral values. If value is a matrix, columns are band values and rows are spectra. |
For spectra<-
, the function does not check if dimensions of spectra match dimensions of Speclib. Additionally, no conversion into matrix
is performed! If spectra are not correctly stored, errors in other functions may arise. Thus check always carefully, if spectra are modified by hand.
For spectra<-
, the updated object. Otherwise a matrix of the spectra in x is returned.
Lukas Lehnert
data(spectral_data) ## Manual plot of the first spectrum plot(wavelength(spectral_data), spectra(spectral_data)[1,], type="l")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.