Learn R Programming

diveMove (version 0.7-4)

diveMove-internal: Internal diveMove Functions

Description

Functions used for very particular tasks within larger functions in diveMove

Usage

.diveIndices(diveID, diveNo)
.getInterval(time)
.speedStats(x, vdist)
.night(time, sunrise.time, sunset.time)
.rleActivity(time, act, interval)
.speedCol(x)

Arguments

diveID
Numeric vector of all dive and non dive IDs.
diveNo
Numeric vector of unique dive indices to extract from diveID.
time
POSIXct object representing time.
x
For .speedStats, a matrix with a dive's section data (time, speed). A single dive's data, a 3-col matrix with time, depth, and speed. For .speedCol, a data frame where names are searched for strings matching .speedNames
vdist
Vertical distance travelled during this time. If vdist is missing, then it's all horizontal movements (no angles).
sunrise.time, sunset.time
Passed from plotTD.
act
A numeric vector indicating the activity for every element of time.
interval
Sampling interval in seconds.

Value

  • .diveIndices returns a numeric vector with the indices of dives (and their beginning/end indices) in diveID.

    .getInterval returns a scalar, the mode of intervals between time readings.

    .speedStats returns a 3-column matrix with total distance, mean speed, and angle for a section of a dive.

    .night returns a list with sunrise and sunset times for dates in time.

    .speedCol returns column number where speed is located in x.

    .rleActivity returns a list with components:

  • time.brA factor dividing act into different periods of activity.
  • time.peractThe duration of each period of activity.
  • beg.time, end.timePOSIXct objects indicating the beginning and ending times of each period of activity.

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.

.speedNames is a character vector with possible names for a speed vector.

.rleActivity takes a factor indicating different activity phases, their associated time, and the sampling interval to return a factor uniquely identifying each phase of activity, i.e. labelling them. In addition, it returns the duration of each phase, and their beginning and end times.