detPhase-internal: Detect phases of activity from depth readings

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Functions to identify sections of a TDR record displaying one of three possible activities: dry, wet, and trivial wet.

Usage

1
.detPhase(time, depth, dry.thr, wet.cond, wet.thr, interval)

Arguments

time

POSIXct object with date and time for all depths.

depth

numeric vector with depth readings.

dry.thr, wet.cond, wet.thr

As passed from calibrateDepth.

interval

As passed from calibrateDepth; sampling interval in seconds.

Details

See calibrateDepth.

Value

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.

Author(s)

Sebastian P. Luque [email protected] and Andy Liaw.

See Also

.detDive, calibrateDepth

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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, interact=FALSE)
rect(xleft=detp$begin, xright=detp$end, ybottom=0, ytop=-4,
     col=seq_along(detp$begin))

diveMove documentation built on May 2, 2019, 4:47 p.m.