Learn R Programming

diveMove (version 0.6-6)

diveMove-internal: Internal diveMove Functions

Description

Functions used for very particular tasks within larger functions in diveMove

Usage

.cutDive(x)
.descAsc(x, phase, type=c("all", "strict"), interval, z=0)
.diveIndices(diveID, diveNo)
.getInterval(time)
.getSpeedCalib(time, zdepth, speed, dives, phase, ...)
.getSpeedStats(x, vdist)

Arguments

x
a single dive's data; for .cutDive: a 2-col matrix with subscript in original TDR object and non NA depths. For .descAsc: a 4-col matrix with dive id, time, depth, and speed. For .getSpeedStats: a 3-co
time
POSIXct object representing time.
dtformat
A string to interpret date and time (see strptime.
phase
factor labelling each row for its phase in dive.
type
string indicating whether all points belonging to descent/ascent should be included (all), or points shared with bottom phase should be excluded (srict).
interval
sampling interval in seconds.
z
minimum depth differences to use.
zdepth
zero-offset corrected depth m.
speed
speed in m/s. For doSpeedCalib: uncalibrated speeds; ignored if calType is none.
dives
3-col data.frame with dive id (numeric), activity (factor), and postdive id (numeric).
...
arguments to pass to .descAsc (type, interval, and z).
vdist
vertical distance travelled during ascent or descent.
diveID
Numeric vector of all dive and non dive IDs.
diveNo
Numeric vector of unique dive IDs to index in diveID.

Value

  • .getSpeedCalib: A list with two elements (named descent and ascent). Each element is a 2-column matrix with rate of depth change in the first column, and speed in the second, corresponding to the descent phase of each dive.

Details

These functions are not meant to be called directly by the user, as he/she could not care less (right?). This may change in the future.

.getSpeedCalib extracts the rates of descent and ascent with associated mean speed during descent and ascent phases, respectively and returns a list that is later manipulated by doSpeedCalib to calibrate speed. The speed used for each rate of depth change corresponds to the speed read for the last point, assuming that each speed reading is the average speed for the last measurement interval.