.detPhase {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.cond, wet.thr, interval)
time |
|
depth |
numeric vector with depth readings. |
dry.thr , wet.cond , wet.thr |
As passed from
|
interval |
As passed from |
See calibrateDepth
.
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 |
end |
A |
Sebastian P. Luque spluque@gmail.com and Andy Liaw.
data(divesTDR)
depths <- getDepth(divesTDR)
times <- getTime(divesTDR)
detp <- diveMove:::.detPhase(times, depths, dry.thr=70, wet.thr=3610,
interval=getDtime(divesTDR))
## Plot detected phases
plotTDR(times, depths)
rect(xleft=detp$begin, xright=detp$end, ybottom=0, ytop=-4,
col=seq_along(detp$begin))