Subset an adp (acoustic Doppler profile) object, in a manner that is function is somewhat analogous to subset.data.frame().

# S4 method for adp
subset(x, subset, ...)

Arguments

x

an adp object.

subset

A condition to be applied to the data portion of x. See ‘Details’.

...

Ignored.

Value

An adp object.

Details

For any data type, subsetting can be by time, ensembleNumber, or distance. These may not be combined, but it is easy to use a string of calls to carry out combined operations, e.g. subset(subset(adp,distance<d0), time<t0)

For the special case of AD2CP data (see read.adp.ad2cp()), it is possible to subset to the "average" data records with subset="average", to the "burst" records with subset="burst", or to the "interleavedBurst" with subset="interleavedBurst"; note that no warning is issued, if this leaves an object with no useful data.

See also

Examples

library(oce) data(adp) # 1. Look at first part of time series, organized by time earlyTime <- subset(adp, time < mean(range(adp[['time']]))) plot(earlyTime)
# 2. Look at first ten ensembles (AKA profiles) en <- adp[["ensembleNumber"]] firstTen <- subset(adp, ensembleNumber < en[11]) plot(firstTen)