wiggles: Count/Extract wiggles in 2D dataset.

Description Usage Arguments References Examples

Description

According to Halsey et al. 2007 (see references): Wiggles are a particular pattern in the dive profile over time during a dive where an increase in depth over time changes to a decrease in depth and then back to an increase in depth. This creates a short period in the dive profile that is concave in shape. Wiggles are defined as elements of the dive profile during which at three points the vertical speed passes below 0 m/s. (NB: If useful, certain wiggles could be ignored, e.g. using a threshold based on their depth range or duration.). This function implements this definition of the wiggle and is primarily intended to be used on dive profile but it can be useful to extract the inversions in any kind of 2D data having a monotonous x variable.

Usage

1
2
3
wiggles(x, y = NULL, thres.y = 2.5, thres.x = c(10, Inf), step = NULL,
  step.thres.y = NULL, step.thres.x = c(10, Inf), output = c("wig-count",
  "stp-count", "table"), plt = FALSE, bsm = NULL)

Arguments

x

The x data. A monotonous variable such as the time sequence of a TDR dataset. Can also be a list of x and y (processed by xy.coords). If x is a data frame with motre than two columns the fist two columns are used.

y

The y data.

thres.y

minimum y difference within a wiggle for it to be taken into account. The default values are usually appropriate if Y is a depth variable from a southern elephant seal dataset. If one value is provided wiggles are kept if the y differences are greater than this threshold. If two values are provided wiggles are kept when the y differences lie between these thresholds. This threshold is used by optBrokenstick in conjunction with max_dist_cost so it can not be set to NULL unless a value is passed to the bsm argument.

thres.x

minimum x difference within a wiggle for it to be taken into account. The default value is usually appropriate if X is a time variable from a southern elephant seal dataset. If one value is provided wiggles are kept when the x differences are greater than this threshold. If two values are provided wiggles are kept if the x differences lie between these thresholds. NULL is equivalent to c(0, Inf).

step

A vertical speed threshold defining "steps" (0.35 m/s for king penguin). If NULL then steps are ignored.

step.thres.y

similar to thres.y but applies to steps only.

step.thres.x

similar to thres.x but applies to steps only.

output

Should the function return the number of wiggles ("wig-count"), the number of steps ("stp-count") or a data frame with width, height and height/width ratio for each transit/step/wiggle identified ("table").

plt

Should graphics about processing be plotted ?

bsm

To speed up the process you can provide a brokenstick model to use directly instead of computing a new one from x and y data.

References

Halsey, L.G., Bost, C.-A., Handrich, Y. (2007) A thorough and quantified method for classifying seabird diving behaviour. Polar Biology, 30, 991-1004.

Examples

1
2
3
4
5
6
7
8
9
data(exses)

# Number of wiggles can be used as a proxy of the foraging activity
sunflowerplot(tdrply(wiggles, ty = '_', obj = exses), exses$stat$pca)
sunflowerplot(tdrply(wiggles, ty = '_', obj = exses, step = 0.35), exses$stat$pca)

# Identifying steps as well
tdrply(wiggles, c("time", "depth"), ty = '_', no = 65, obj = exses, 
       step = 0.35, output = "table", plt = TRUE)

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