detPhase-internal {diveMove} | R Documentation |
Functions to identify sections of a TDR record displaying one of three possible activities: dry, wet, and trivial wet.
.detPhase(time, depth, dry.thr, wet.thr, ...)
time |
POSIXct object with date and time for all depths. |
depth |
Numeric vector with depth readings. |
dry.thr, wet.thr |
Passed from calibrateDepth . |
... |
Passed from calibrateDepth ; sampling
interval in seconds. |
.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.
A list with components:
phase.id |
Numeric vector identifying each activity phase, starting from 1 for every input record. |
activity |
Factor 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. |
begin |
A POSIXct object as long as the number of
unique activity phases identified, indicating the start times for
each activity phase. |
end |
A POSIXct object as long as the number of
unique activity phases identified, indicating the end times for each
activity phase. |
Sebastian P. Luque spluque@gmail.com and Andy Liaw.