decimate {oce} | R Documentation |
Decimate, or subsample, an oce object.
decimate(x, by=10, method=c("direct", "filter"), filter)
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. |
method |
only one is provided at the moment: direct , which
indicates straight decimate, or subsampling. |
filter |
a list of numbers representing a digital filter to be
applied to each variable in x$data before decimation is
done. This must be supplied if method="filter" . |
Later on, other methods will be added, and
ctd.decimate
will be retired in favour of this, a more
general, function.
The filtering is done with the filter
function of the
stats package. This produces NA values near the start and end of the
series, and since this is bothersome in some applications,
decimate
substitutes the original values in those spots.
An object of class
"oce"
that has been
subsampled appropriately.
Dan Kelley
ctd.decimate
, which will be retired when the present
function gains equivalent functionality.
library(oce) data(ctd) d <- decimate(ctd, by=5) plot(d)