Extract Speclib by index | R Documentation |
Access subsets of data in Speclibs both in spectrals and sample dimensions
## S4 method for signature 'Speclib' x[i, j, ...]
x |
Object of class |
i |
Samples to be returned. |
j |
Bands to be returned. |
... |
Further arguements (currently ignored). |
The first index represents the sample dimension and the second one is the band dimension. If the sample dimension is indexed, care is taken that the SI and the id is indexed as well.
Object of class Speclib
containing the updated version of x.
Lukas Lehnert
Speclib
, subset.speclib
, SI
, idSpeclib
data(spectral_data) ## Get the first five spectra spec_1_5 <- spectral_data[1:5,] spec_1_5 ## Get the first ten bands spec_1_10 <- spectral_data[,1:10] spec_1_10 ## Get the bands number 20 to 30 for the third and fifth spectra spec_20_30 <- spectral_data[c(3,5),20:30] spec_20_30
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.