Description Usage Arguments Details Value Notes Acknowledgements See Also Examples
The generic import_ride
dispatches methods based on the
file extension of file_path
. See Details for currently
supported file formats. The default method (i.e. for unsupported formats)
will raise an error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import_ride(file_path, ...)
## S3 method for class 'fit'
import_ride(file_path, raw = FALSE, make_laps = TRUE, ...)
## S3 method for class 'pwx'
import_ride(file_path, ...)
## S3 method for class 'tcx'
import_ride(file_path, make_laps = TRUE, ...)
## S3 method for class 'gpx'
import_ride(file_path, ...)
## S3 method for class 'srm'
import_ride(file_path, ...)
|
file_path |
character string; path to the file to be read. Can be absolute or relative. |
... |
further arguments passed to or from other methods. |
raw |
logical; if |
make_laps |
logical; append a lap column to the data (if available)? |
These functions will do very little with the parsed data by default.
This is to allow for more flexibility, but can cause headaches for batch
analysing files of mixed formats (see clean_bikedata
for a
solution).
Timestamps are converted to POSIXct
when available.
Currently supported formats are:
pwx:Training Peaks pwx files (an XML format).
fit:Garmin fit files (a binary format).
tcx:Garmin training center files (an XML format).
gpx:GPS Exchange Format (a lame XML format).
srm:SRM power control files (a binary format).
Tabular data are always returned as dplyr tbl
objects.
This ensures clean printing and makes data easier to work with.
With very few exceptions, these functions return data as a
tbl_df
, with the additional attribute
"file_ext"
.
Garmin Fit files return positional coordinates in units of
semicircles. These are converted to degrees by default (if raw =
FALSE
).
XML file formats are parsed using the pugixml C++ library.
SRM parsing code was adapted from the code in the Golden Cheetah repository (which can be found here).
clean_bikedata
for creating consistent output from
these functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
ride_files <- list.files(
system.file("extdata", package = "elpatron"),
full.names = TRUE)
(f <- sample(ride_files, 1))
import_ride(f)
## If you want all data from the .fit format...
f <- grep("fit$", ride_files, value = TRUE)
import_ride(f, raw = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.