subset_speclib: Subsetting speclibs

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

Description

Function to return subsets of Speclibs by defined 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. 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

Speclib, SI, mask

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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 documentation built on Dec. 14, 2017, 5:16 p.m.