Learn R Programming

segclust2d (version 0.3.3)

calc_speed: Calculate speed along a path

Description

calc_dist calculate speed between locations, taking a dataframe as input. Speed can also be smoothed over the two steps before and after the each point.

Usage

calc_speed(
  x,
  coord.names = c("x", "y"),
  timecol = "dateTime",
  smoothed = FALSE,
  units = "hour"
)

Value

vector of distance

Arguments

x

data.frame with locations

coord.names

names of coordinates column in x

timecol

names of POSIXct time column

smoothed

whether speed are smoothed or not

units

units for time calculation. Default "hour"

Author

Remi Patin

Examples

Run this code
if (FALSE) calc_speed(df,coord.names = c("x","y"), timecol = "dateTime",
smoothed = T)

Run the code above in your browser using DataLab