speclib_indexing: Indexing Speclib

Extract Speclib by indexR Documentation

Indexing Speclib

Description

Access subsets of data in Speclibs both in spectrals and sample dimensions

Usage

## S4 method for signature 'Speclib'
x[i, j, ...]

Arguments

x

Object of class Speclib to be indexed.

i

Samples to be returned.

j

Bands to be returned.

...

Further arguements (currently ignored).

Details

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.

Value

Object of class Speclib containing the updated version of x.

Author(s)

Lukas Lehnert

See Also

Speclib, subset.speclib, SI, idSpeclib

Examples

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

hsdar documentation built on March 18, 2022, 6:35 p.m.