read_ride {cycleRtools}R Documentation

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. Critical power and session RPE metrics can also be associated with the data and used by other functions (e.g. summary.cycleRdata).

Usage

read_ride(file = file.choose(), format = TRUE, CP = NULL, sRPE = NULL)

read_fit(file = file.choose(), format = TRUE, CP = NULL, sRPE = NULL)

read_pwx(file = file.choose(), format = TRUE, CP = NULL, sRPE = NULL)

read_srm(file = file.choose(), format = TRUE, CP = NULL, sRPE = NULL)

read_tcx(file = file.choose(), format = TRUE, CP = NULL, sRPE = NULL)

Arguments

file

character; path to the file.

format

logical; should data be formatted?

CP, sRPE

optional; critical power and session RPE values to be associated with the data. Ignored if format = FALSE.

Details

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 ridedata.

Garmin .fit file data is parsed with the java command line tool provided in the 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 Rainer Clasen's srmio library is installed and available. The associated GitHub repo' can be found here.

Value

a data frame object.

Functions

Examples

## Not run: 
fl  <- system.file("extdata/example_files.tar.gz",
                   package = "cycleRtools")
fls <- untar(fl, list = TRUE)
untar(fl)  # Extract to working directory.

dat <- lapply(fls, read_ride, format = TRUE, CP = 300, sRPE = 5)

file.remove(fls)

## End(Not run)


[Package cycleRtools version 1.1.1 Index]