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

spectra

Handling spectra


Description

Returning and setting spectra in Speclib

Usage

## 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

Arguments

object

Object of class Speclib.

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: return_names: Logical indicating, if names of columns and rows should be set to bandnames and idSpeclib.

value

Matrix or RasterBrick-object containing spectral values. If value is a matrix, columns are band values and rows are spectra.

Details

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.

Value

For spectra<-, the updated object. Otherwise a matrix of the spectra in x is returned.

Author(s)

Lukas Lehnert

See Also

Examples

data(spectral_data)

## Manual plot of the first spectrum
plot(wavelength(spectral_data), spectra(spectral_data)[1,], type="l")

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.