Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

speclib_indexing

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

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

Manage, Analyse and Simulate Hyperspectral Data

v1.0.3
GPL
Authors
Lukas W. Lehnert [cre, aut] (<https://orcid.org/0000-0002-5229-2282>), Hanna Meyer [ctb], Joerg Bendix [ctb]
Initial release
2020-08-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.