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

subset_speclib

Subsetting speclibs


Description

Function to return subsets of Speclibs by defined conditions.

Usage

## S4 method for signature 'Speclib'
subset(x, subset, ...)

Arguments

x

Object of class 'Speclib'.

subset

Logical expression indicating spectra to keep: missing values are taken as false. Multiple expressions can be applied using logical operators AND and OR. See details section.

...

Further arguments passed to agrep.

Details

Matchable objects are SI data. Use column names to identify the respective SI. See SI to access SI of a Speclib. IDs of spectra may be accessed using "id.speclib" as variable name. To subset certain wavelength ranges of a Speclib refer to mask.

Value

Object of class Speclib.

Author(s)

Lukas Lehnert, Wolfgang Obermeier

See Also

Examples

data(spectral_data)

## Return names of SI data
names(SI(spectral_data))

## Divide into both seasons
sp_summer <- subset(spectral_data, season == "summer")
sp_spring <- subset(spectral_data, season == "spring")

## Divide into both seasons and years
sp_summer_14 <- subset(spectral_data, season == "summer" & year == 2014)
sp_spring_14 <- subset(spectral_data, season == "spring" & year == 2014)

## Plot all speclibs
plot(sp_spring_14, col="green", ylim = c(0,80))
plot(sp_summer_14, col="red", new = FALSE)

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.