subset_speclib: Subsetting speclibs

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Return subsets of Speclibs which meet conditions.

Usage

1
2
## 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. 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

See Also

Speclib, SI, mask

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(spectral_data)

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

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

## Plot both speclibs
plot(sp_summer, col="darkgreen")
plot(sp_spring, col="darkred", new=FALSE)

hsdar documentation built on Nov. 17, 2017, 4:35 a.m.