mutate_with_speed: Augments a Activatr DF with a speed variable.

Description Usage Arguments Value

View source: R/mutate.R

Description

This returns a mutated Activatr DF with a new column representing speed, in meters per second. The speed is determined by looking at the time difference between the current point and the previous point: hence, it is always NA for the first row in the data frame.

Usage

1
mutate_with_speed(df, method = c("2D", "3D"), lead = 0, lag = 1)

Arguments

df

A Activatr DF: a tibble from parse_gpx or parse_tcx.

method

If 2D (default), ignores elevation. If 3D, includes elevation.

lead

How far ahead to look for the "end" point

lag

How far behind to look for the "start" point

Value

That same Activatr DF, but with a new speed column, in meters per second.


activatr documentation built on Jan. 15, 2021, 3:36 p.m.