atl_turning_angle: Get the turning angle between points.

Description Usage Arguments Value Author(s) Examples

View source: R/fun_get_angle.R

Description

Gets the relative heading between two positions using the law of cosines. The turning angle is returned in degrees. Users should apply this function to one individual at a time, ideally by splittng a dataframe with multiple individuals into a list of dataframes.

Usage

1
atl_turning_angle(data, x = "x", y = "y", time = "time")

Arguments

data

A dataframe or similar which must have the columns specified by x, y, and time.

x

The x coordinate.

y

The y coordinate.

time

The timestamp in seconds since the UNIX epoch.

Value

A vector of turning angles in degrees. Negative degrees indicate 'left' turns. There are two fewer angles than the number of rows in the dataframe.

Author(s)

Pratik R. Gupte

Examples

1
2
3
4
5
6
## Not run: 
data$angle <- atl_turning_angle(data,
  x = "x", y = "y", time = "time"
)

## End(Not run)

pratikunterwegs/atlastools documentation built on Nov. 7, 2021, 7:14 p.m.