Subsetting speclibs

Share:

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 attributes data. Use column names to identify the respectrive attribute. See attribute to access attributes of a Speclib. IDs of spectra may be accessed using "id.speclib" as variable name.

Value

Object of class Speclib.

Author(s)

Lukas Lehnert

See Also

Speclib, attribute

Examples

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

## Return names of attributes data
names(attribute(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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.