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

applySpeclib

Apply function for class Speclib


Description

Apply function over all spectra or a subset of spectra in a Speclib.

Usage

## S4 method for signature 'Speclib'
apply(X, FUN, bySI = NULL, ..., simplify = TRUE)

Arguments

X

Object of class Speclib

FUN

Function to be applied. Matched with match.fun.

bySI

Character string giving the name of the column in the SI to be used as subsets to apply function FUN on.

...

Further arguments passed to FUN.

simplify

Currently ignored.

Value

Object of class Speclib.

Author(s)

Lukas Lehnert

See Also

Examples

data(spectral_data)

mean_spectrum <- apply(spectral_data, FUN = mean)
plot(mean_spectrum)

## Same as above but seperately for both seasons
mean_spectra <- apply(spectral_data, FUN = mean, bySI = "season")
plot(mean_spectra[1, ], ylim = c(0,50))
plot(mean_spectra[2, ], new = FALSE)
SI(mean_spectra)

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.