Learn R Programming

cycleRtools (version 1.0.4)

read: Read cycling device data.

Description

Read data from a cycling head unit into the R environment; optionally formatting it for use with other functions in this package.

Usage

read(file = file.choose(), format = TRUE)

read_fit(file = file.choose(), format = TRUE)

read_pwx(file = file.choose(), format = TRUE)

read_srm(file = file.choose(), format = TRUE)

read_tcx(file = file.choose(), format = TRUE)

Arguments

file
character; path to the file.
format
logical; should data be formatted?

Value

  • a data frame object.

Functions

  • read: A wrapper for read_* functions that chooses the appropriate function based on file extension.
  • read_fit: Read a Garmin (Ltd) device .fit file. This invokessystem2to execute the FitCSVTool.jar command line tool (seehttp://www.thisisant.com/resources/fit{FIT SDK}). Hence, this function requires that Java (JRE/JDK) binaries be on the system path.
  • read_pwx: Read a Training Peaks .pwx file. Requires the "xml2" package to be installed. Will make use of the "parallel" package if available.
  • read_srm: Read an SRM (.srm) file. This requireshttp://www.zuto.de/project/srmio/{Rainer Clasen's srmio library} to be installed and on the system path.
  • read_tcx: Read a Garmin .tcx file. Requires the "xml2" package to be installed. Will make use of the "parallel" package if available.

Details

Returns a data frame with all data parsed from the file; with an additional lap (factor) column appended in the case of read_fit().

Note that most functions within this package depend on imported data being formatted; i.e. read*("file_path", format = TRUE). Hence, unless the raw data is of particular interest and/or the user wants to process it manually, the format argument should be TRUE (default). When working with a formatted dataset, do not change existing column names. The formatted data structure is described in detail in cycling_data.

Garmin .fit file data is parsed with the java command line tool provided in the http://www.thisisant.com/resources/fit{FIT SDK}. The latest source code and licensing information can be found at the previous link.

SRM device files (.srm) are also parsed at the command line, provided http://www.zuto.de/project/srmio/{Rainer Clasen's srmio library} is installed and available. The associated GitHub repo' can be found https://github.com/rclasen/srmio{here}.