detPhase-internal: Detect phases of activity from depth readings
Description
Functions to identify sections of a TDR record
displaying one of three possible activities: dry, wet, and trivial
wet.Usage
.detPhase(time, depth, dry.thr, wet.thr, ...)
Arguments
time
POSIXct object with date and time for all depths.
depth
Numeric vector with depth readings.
Value
- A list with components:
- phase.idNumeric vector identifying each activity phase,
starting from 1 for every input record.
- activityFactor with levels L indicating dry,
W indicating wet, U for underwater (above dive
criterion), D for diving, Z for trivial wet animal
activities. Only L, W, and Z are
actually represented.
- beginA
POSIXct object as long as the number of
unique activity phases identified, indicating the start times for
each activity phase. - endA
POSIXct object as long as the number of
unique activity phases identified, indicating the end times for each
activity phase.
Details
.detPhase first creates a factor with value L
(dry) for rows with NAs for depth and value W (wet)
otherwise. It subsequently calculates the duration of each of these
phases of activity. If the duration of an dry phase (L) is
less than dry.thr, then the values in the factor for that phase
are changed to W (wet). The duration of phases is then
recalculated, and if the duration of a phase of wet activity is less
than wet.thr, then the corresponding value for the factor is
changed to Z (trivial wet). The durations of all phases are
recalculated a third time to provide final phase durations.