subset.rspec {pavo} | R Documentation |
Subset rspec, vismodel, and colspace objects
Description
Subsets various object types based on a given vector or grep partial matching of data names.
Usage
## 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 |
subset |
a string used for partial matching of observations. |
... |
additional attributes passed to |
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 cme16@zips.uakron.edu
Examples
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"))
head(subset(sicalis, c("B", "C")))
head(subset(sicalis, "T", invert = TRUE))
subset(vis.sicalis, "C")
subset(tcs.sicalis, "C")[, seq_len(5)]
[Package pavo version 2.9.0 Index]