time_at_depth: Compute the Time Allocation at Depth (TAD) index of a dive

Description Usage Arguments Details References Examples

Description

Compute the Time Allocation at Depth (TAD) index of a dive

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
time_at_depth(x, vs = Inf, fs = NULL, ...)

## Default S3 method:
time_at_depth(x, vs = Inf, fs = NULL, ...)

## S3 method for class 'tdr'
time_at_depth(x, vs = Inf, ...)

## S3 method for class 'bsm'
time_at_depth(x, vs = Inf, ...)

## S3 method for class 'ses'
time_at_depth(x = ind(), vs = Inf, ...)

Arguments

x

input data. Can be a numeric vector of depth records (then sampling frequency should be provided), a data frame with time and depth as columns 1 & 2 or some bsm/tdr/ses objects.

vs

Maximum vertical speed achievable.

fs

Sampling frequency (in Hz). Optional if a full time sequence is provided.

...

na.rm or other arguments (mainly for S3 methods compatibility).

Details

The index takes values from 0 for a dive where the maximum of time was spent at the minimum depth, to 0.5 for "V" shaped dives and 1 for "U" shaped dives. "ses" and "tdr" methods assume that time and depth information respectively occupy the first and second columns of the tdr tables.

References

Fedak, M. A., Lovell, P. and Grant, S. M. (2001). Two Approaches to Compressing and Interpreting Time-Depth Information as as Collected by Time-Depth Recorders and Satellite-Linked Data Recorders. Marine Mammal Science 17, 94–110.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(exses)
bsm_6pts <- tdrply(brokenstick, 1:2, obj = exses)
# These 4 lines return the same result
tad_highres <- tdrply(time_at_depth, 2, obj = exses, vs = 2, fs = 1)
tad_highres <- tdrply(time_at_depth, 1:2, obj = exses, vs = 2)
tad_highres <- sapply(bsm_6pts, time_at_depth, vs = 2) # "data" slot is used
exses$stat$tad <- tad_highres <- time_at_depth(exses, vs = 2)
# When the "data" slot is not available
tad_lowres <- sapply(eco.mem(bsm_6pts), time_at_depth, vs = 2) # "data" slot is not used

plot(tad_highres, tad_lowres) ; abline(0, 1, col = "red", lwd = 3)
plot(tad ~ time, exses$stat)

SESman/rbl documentation built on May 9, 2019, 11:10 a.m.