R: Internal Functions used for Detection of Dives

labDive-internal {diveMove} | R Documentation

## Internal Functions used for Detection of Dives

### Description

These functions provide information for particular dives,

### Usage

    .cutDive(x, dive.model, smooth.par=NULL, knot.factor, sigmasq=2,
             g=min(max(10, nrow(x) - 4), 25), ordpen=2,
             descent.crit.q, ascent.crit.q)
    .labDive(act, string)
    .labDivePhase(x, diveID, ...)

### Arguments

`x` | For `.labDivePhase`, a class `TDR` object. For `.cutDive`, a 3-col matrix with subscript in original TDR object, non NA depths, and numeric vector representing `POSIXct` times.
`dive.model, smooth.par, knot.factor, sigmasq, g, ordpen, descent.crit.q, ascent.crit.q` | Passed from `calibrateDepth`.
`g, ordpen` | default arguments for `unireg`, so only relevant for `divemodel="unimodal"`.
`act` | factor with values to label.
`string` | character string belonging to a level of `act` to search for and label sequentially.
`diveID` | numeric vector indexing each dive (non-dives should be 0)
`...` | Arguments passed to `.cutDive` (`smooth.par` and `knot.factor`).

### Details

These functions are for internal use and are not meant to be called by the user.

### Value

`.labDive` returns a matrix with as many rows as its first two arguments with two columns: dive.id, and postdive.id, each one sequentially numbering each dive and postdive period.

`.labDivePhase` returns a list with a factor having levels “D”, “DB”, “B”, “BA”, “A”, “DA”, and “X”, breaking the input into descent, descent/bottom, bottom, bottom/ascent, ascent, and non-dive, respectively. If `x` contains no dives, only level “X” is present for all readings. The list also contains another list with `diveModel` objects for each dive.

`.cutDive` generates a `diveModel` object with details of model used to detect dive phases using cubic spline smoothing and its first derivative.

### Author(s)

Sebastian P. Luque spluque@gmail.com

[Package diveMove version 1.5.2 Index]