Learn R Programming

diveMove (version 0.7-2)

calibrateDepth: Calibrate and build a "TDRcalibrate" object

Description

These functions create a "TDRcalibrate" object which is necessary to obtain dive summary statistics.

Usage

calibrateDepth(x, dry.thr=70, wet.thr=3610, dive.thr=4, offset,
               descent.crit.q=0.1, ascent.crit.q=0.1, wiggle.tol=0.8)
calibrateSpeed(x, tau=0.1, contour.level=0.1, z=0, bad=c(0, 0),
               main=slot(getTDR(x), "file"), coefs, plot=TRUE,
               postscript=FALSE, ...)

Arguments

x
an object of class TDR for calibrateDepth or an object of class TDRcalibrate for calibrateSpeed.
dry.thr, wet.thr
arguments to detPhase.
dive.thr
argument to detDive.
offset
argument to zoc.
descent.crit.q
critical quantile of rates of descent below which descent is deemed to have ended.
ascent.crit.q
critical quantile of rates of ascent above which ascent is deemed to have started.
wiggle.tol
Proportion of maximum depth above which wiggles should not be allowed to define the end of descent. It's also the proportion of maximum depth below which wiggles should be considered part of bottom phase.
tau
quantile on which to regress speed on rate of depth change; passed to rq.
contour.level
the mesh obtained from the bivariate kernel density estimation corresponding to this contour will be used for the quantile regression to define the calibration line.
z
only changes in depth larger than this value will be used for calibration.
bad
length 2 numeric vector indicating that only rates of depth change and speed greater than the given value should be used for calibration, respectively.
coefs
known speed calibration coefficients from quantile regression as a vector of length 2 (intercept, slope). If provided, these coefficients are used for calibrating speed, ignoring all other arguments, except x.
main, ...
arguments passed to rqPlot.
plot
logical indicating whether to plot the results.
postscript
logical indicating whether to produce postscript file output.

Value

Details

These functions are really wrappers around functions that are usually called in sequence, so they provided an abbreviated method for running them together during analyses. See the functions in the See Also section for more details.

calibrateDepth performs zero-offset correction of depth, wet/dry phase detection, and detection of dives, as well as proper labelling of the latter.

calibrateSpeed calibrates speed readings.

See Also

detPhase, detDive, zoc, rqPlot, for the underlying functions.

Examples

Run this code
data(divesTDR)

## Consider a 3 m offset, and a dive threshold of 3 m
dcalib <- calibrateDepth(divesTDR, dive.thr=3, offset=3)
plotTDR(dcalib, labels="dive.phase", surface=TRUE)

## Calibrate speed using only changes in depth > 2 m
vcalib <- calibrateSpeed(dcalib, z=2)

Run the code above in your browser using DataLab