subset.oce {oce}R Documentation

Subset an oce object

Description

Subset an oce object

Usage

## S3 method for class 'oce':
subset(x, subset, indices=NULL, ...)

Arguments

x an oce object.
subset a condition to be applied to the data portion of x (ignored for station objects).
indices list of station indices (used only for section objects).
... ignored.

Details

This is analogous to subset.data.frame. Note that it only works for objects in which the data portion is a data frame, e.g. ctd objects.

For objects of class adp, the subset may be in terms of time or distance; to combine these, use two steps (see “Examples”).

Value

A new oce object.

Author(s)

Dan Kelley

See Also

subset.data.frame, upon which this is based.

Examples

library(oce)
# CTD data
data(ctd)
plot(ctd)
plot(subset(ctd, pressure>10))

# ADP example, subsetted by time and distance
data(adp)
adp.near <- subset(adp, distance < 10)
# Note that the data may be accessed directly, as below
adp.near.early <- subset(adp.near, time < mean(adp.near$data$ts$time))
plot(adp.near.early)

[Package oce version 0.1-80 Index]