mutate_with_distance: Augments a Activatr DF with a distance variable.

Description Usage Arguments Value

View source: R/mutate.R

Description

This returns a mutated Activatr DF with a new column representing distance, in meters. The distance is determined by looking at the lat/lon delta 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_distance(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 distance column, in meters.


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