Learn R Programming

oce (version 0.2-1)

decimate: Decimate an oce object

Description

Decimate, or subsample, an oce object.

Usage

decimate(x, by=10, to, filter, debug=getOption("oceDebug"))

Arguments

x
an oce object containing a data element.
by
an indication of the subsampling. The first element is selected, then the 1+by element, etc. This is ignored if to is given.
to
Indices at which to subsample. If given, this over-rides by.
filter
optional list of numbers representing a digital filter to be applied to each variable in x$data before decimation is done. If not supplied, then the decimation is done strictly by sub-sampling.
debug
a flag that turns on debugging. Set to 1 to get a moderate amount of debugging information, or to 2 to get more.

Value

  • An object of class "oce" that has been subsampled appropriately.

Details

Later on, other methods will be added, and ctdDecimate will be retired in favour of this, a more general, function. The filtering is done with the filter function of the stats package.

See Also

Filter coefficients may be calculated using makeFilter. (Note that ctdDecimate will be retired when the present function gains equivalent functionality.)

Examples

Run this code
library(oce)
data(adp)
plot(adp)
adp.dec <- decimate(adp,by=2,filter=c(1/4,1/2,1/4))
plot(adp.dec)

Run the code above in your browser using DataLab