act_tblwith a speed column
This returns a mutated
act_tbl with a new column
representing speed, in meters per second. See
mutate_with_speed(df, method = c("2D", "3D"), lead = 0, lag = 1)
If "2D" (default), ignores elevation. If "3D", includes elevation. "3D" is not often necessary, but for skiing activities is likely to yield a more accurate value.
How far ahead to look for the "end" point.
How far behind to look for the "start" point.
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.
lag values are helpful to get "smoother" values, especially
if the provided activity file has GPS errors in it.
act_tbl, but with a new
in meters per second.
example_gpx_file <- system.file( "extdata", "running_example.gpx.gz", package = "activatr" ) example_act_tbl <- parse_gpx(example_gpx_file) example_act_tbl_with_speed <- mutate_with_speed(example_act_tbl) example_act_tbl_with_speed
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.