atl_get_speed: Calculate instantaenous speed.

Description Usage Arguments Value Author(s) Examples

View source: R/fun_get_speed.R

Description

Returns speed in metres per time interval. The time interval is dependent on the units of the column specified in time. 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_get_speed(data, x = "x", y = "y", time = "time", type = c("in"))

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.

type

The type of speed (incoming or outgoing) to return. Incoming speeds are specified by type = "in", and outgoing speeds by type = "out".

Value

A vector of numerics representing speed. The first position is assigned a speed of NA.

Author(s)

Pratik R. Gupte

Examples

1
2
3
4
5
6
7
## Not run: 
data$speed_in <- atl_get_speed(data,
  x = "x", y = "y",
  time = "time", type = c("in")
)

## End(Not run)

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