Learn R Programming

hsdar (version 0.5.1)

subset.nri: Subsetting Nri-objects

Description

Return subsets of Nri-objects which meet conditions.

Usage

"subset"(x, subset, ...)

Arguments

x
Object of class 'Nri'.
subset
Logical expression indicating spectra to keep: missing values are taken as false. See details section.
...
Further arguments passed to agrep.

Value

Object of class Nri.

Details

Matchable objects are attributes data. Use column names to identify the respectrive attribute. See attribute to access attributes of a Nri. IDs of samples may be accessed using "id.nri" as variable name.

See Also

Nri, attribute

Examples

Run this code

data(spectral_data)

## Calculate all possible combinations for WorldView-2-8
spec_WV <- spectralResampling(spectral_data, "WorldView2-8",
                              response_function = FALSE)
nri_WV <- nri(spec_WV, recursive = TRUE)

## Return names of attributes data
names(attribute(nri_WV))

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

## Print both Nri-objects
sp_summer
sp_spring

Run the code above in your browser using DataLab