subset.speclib | R Documentation |
Function to return subsets of Speclib
s by defined conditions.
## S4 method for signature 'Speclib' subset(x, subset, ...)
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 |
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
.
Object of class Speclib
.
Lukas Lehnert, Wolfgang Obermeier
Speclib
, SI
, mask
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.