Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

subset_nri

Subsetting Nri-objects


Description

Return subsets of Nri-objects which meet conditions.

Usage

## S4 method for signature 'Nri'
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.

Details

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

Value

Object of class Nri.

Author(s)

Lukas Lehnert

See Also

Examples

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 SI data
names(SI(nri_WV))

## Divide 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

## Divide into both seasons and years
sp_summer_14 <- subset(nri_WV, season == "summer" & year == 2014)
sp_spring_14 <- subset(nri_WV, season == "spring" & year == 2014)

## Print both Nri-objects
sp_summer_14
sp_spring_14

hsdar

Manage, Analyse and Simulate Hyperspectral Data

v1.0.3
GPL
Authors
Lukas W. Lehnert [cre, aut] (<https://orcid.org/0000-0002-5229-2282>), Hanna Meyer [ctb], Joerg Bendix [ctb]
Initial release
2020-08-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.