subset.rspec: Subset rspec, vismodel, and colspace objects

Description Usage Arguments Value Note Author(s) Examples

View source: R/subset.rspec.R

Description

Subsets various object types based on a given vector or grep partial matching of data names.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'rspec'
subset(x, subset, ...)

## S3 method for class 'colspace'
subset(x, subset, ...)

## S3 method for class 'vismodel'
subset(x, subset, ...)

Arguments

x

(required) an object of class rspec, vismodel, or colspace, containing spectra, visual model output or colorspace data to subset.

subset

a string used for partial matching of observations.

...

additional attributes passed to grep. Ignored if subset is logical.

Value

a subsetted object of the same class as the input object.

Note

if more than one value is given to subset, any spectra that matches either condition will be included. It's a union, not an intersect.

Author(s)

Chad Eliason [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
data(sicalis)
vis.sicalis <- vismodel(sicalis)
tcs.sicalis <- colspace(vis.sicalis, space = 'tcs')

# Subset all 'crown' patches (C in file names)
head(subset(sicalis, "C"))
subset(vis.sicalis, "C")
subset(tcs.sicalis, "C")[, 1:5]
subset(sicalis, c("B","C"))
subset(sicalis, "T", invert=TRUE)

## End(Not run)

pavo documentation built on Oct. 3, 2017, 1:04 a.m.