subset: Subsetting spectra

SubsetR Documentation

Subsetting spectra

Description

Return subsets of spectra stored in class generic_spct or derived from it.

Usage

## S3 method for class 'generic_spct'
subset(x, subset, select, drop = FALSE, ...)

Arguments

x

object to be subsetted.

subset

logical expression indicating elements or rows to keep: missing values are taken as false.

select

expression, indicating columns to select from a spectrum.

drop

passed on to [ indexing operator.

...

further arguments to be passed to or from other methods.

Value

An object similar to x containing just the selected rows and columns. Depending on the columns remaining after subsetting the class of the object will be simplified to the most derived parent class.

Note

This method is copied from base::subset.data.frame() but ensures that all metadata stored in attributes of spectral objects are copied to the returned value.

Examples


subset(sun.spct, w.length > 400)


aphalo/photobiology documentation built on April 1, 2024, 6:48 p.m.