straightness: Compute straightness index

Description Usage Arguments Value Examples

View source: R/funs_behavior.r

Description

straightness compute a straightness index between 0 and 1 by making the ration L / l where L is the cumulated distance between brokenstick points and and where l the cumulated distance between each y data points.

Usage

1
2
3
straightness(x, y = NULL, npts = 3)

sinuosity(x, y = NULL, npts = 3)

Arguments

x

The x data (time).

y

The y data (depth).

npts

The number of points to use. 2 is the minimum (from the start to the end of data). Each new point adds a step (using the brokenstick algorithm) which is taken into account when computing L.

Value

straightness returns a number between 0 (maximum sinuosity) to 1 (maximum straightness). sinuosity is equivalent to 1 / straightness.

Examples

1
2
3
data(exses)
ind(exses)
sunflowerplot(tdrply(straightness, cl = 1:2, ty = '_'), exses$stat$pca)

SESman/rbl documentation built on June 24, 2017, 8:48 a.m.