Description Usage Arguments Details Value Clean structure Examples
These functions implement a consistent and predictable column structure for incoming cycling device data. This should permit, where necessary, batch operations on various different file formats. See below for details of this structure.
1 |
data |
ride data (from |
... |
arguments to be passed to |
Note that these functions do not retain any of the original data
columns. If extra columns want to be retained, extra arguments can be
passed down to select
via ...
If any required columns are missing in the original data
, those
columns of the specification (below) that depend on them will still be
returned, but filled with NA
s.
When imported with import_ride
, the returned data is given a
file extension attribute. This attribute is the basis for method dispatch
here.
a tbl_df
with the column structure as described
above, with a "start_time"
attribute appended where available.
In general, fields should be named as
"field.units"
, where the field is generally written in full. Time
derivatives should be adjacent to their "parent" (e.g. distance, speed;
work, power). If data for any of these columns are missing the column
should be included, but filled with NA
s. The SI unit system should
be adhered to.
Elapsed time since the start of recording, in seconds. Should not start at 0.
Positional coordinates in degrees. Keeping these fields in lon,lat order is in keeping with the x,y convention.
Self-explanatory: cumulative distance covered (kilometres) and speed (kilometres per hour).
Metres above sea level and "vertical ascent metres per second".
Self-explanatory: cumulative work done (kilojoules) and power output (Watts).
Pedal (angular) velocity in revolutions per minute.
Heart rate in beats per minute.
Ambient temperature in degrees Celsius.
A lap counter, starting from 1.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ride_file <- system.file("extdata/lufbra.fit", package = "elpatron")
parsed_ride <- import_ride(ride_file, make_laps = TRUE)
## Simple cleaning:
clean_bikedata(parsed_ride)
## We can also make use of dplyr's select_helpers
## (see ?dplyr::select_helpers)
library(dplyr, warn.conflicts = FALSE)
clean_bikedata(parsed_ride, contains("torque"))
## Trying to hold on to non-existent fields won't throw errors.
clean_bikedata(parsed_ride, contains("epo_concentration"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.