Last chance! 50% off unlimited learning
Sale ends in
a
, a zero value of b
, and an arbitrary value of
t0
. Checking the mismatch before and after an experiment yields
sufficient information to specify a linear drift, via a
, b
,
and t0
. Note that t0
is just a convenience parameter, which
avoids the user having to know the "zero time" used in R and clarifies the
values of the other two parameters. It makes sense for t0
to have
the same timezone as the time within x
.
retime(x, a, b, t0, debug = getOption("oceDebug"))
oce
object (presently, this must be of class adv
)approx
with rule=2
, to avoid NA
values at the
start or end. The new time will be as given by the formula above. Note that
if the drift is large enough, the sampling rate will be changed. It is a
good idea to start with an object that has an extended time range, so that,
after this is called, subset
can be used to trim to a desired
time range.
library(oce)
data(adv)
adv2 <- retime(adv,0,1e-4,as.POSIXct("2008-07-01 00:00:00",tz="UTC"))
plot(adv[["time"]], adv2[["time"]]-adv[["time"]], type='l')
Run the code above in your browser using DataLab