Learn R Programming

trackeR (version 0.0.3)

readX: Read a training file in TCX, db3 or Golden Cheetah's JSON format.

Description

Read a training file in TCX, db3 or Golden Cheetah's JSON format.

Usage

readTCX(file, timezone = "", speedunit = "m_per_s", distanceunit = "m", parallel = FALSE, cores = getOption("mc.cores", 2L), ...)
readDB3(file, timezone = "", table = "gps_data", speedunit = "km_per_h", distanceunit = "km")
readJSON(file, timezone = "", speedunit = "km_per_h", distanceunit = "km")

Arguments

file
The path to the file.
timezone
The timezone of the observations as passed on to as.POSIXct. Ignored for JSON files.
speedunit
Character string indicating the measurement unit of the speeds in the container file to be converted into meters per second. See Details.
distanceunit
Character string indicating the measurement unit of the distance in the container file to be converted into meters. See Details.
parallel
Logical. Should computation be carried out in parallel? (Not supported on Windows.)
cores
Number of cores for parallel computing.
...
Currently not used.
table
Character string indicating the name of the table with the GPS data in the db3 container file.

Details

Available options for speedunit currently are km_per_h, m_per_s, mi_per_h, ft_per_min and ft_per_s. The default is m_per_s for TCX files and km_per_h for db3 and Golden Cheetah's json files. Available options for distanceunit currently are km, m, mi and ft. The default is m for TCX files and km for db3 and Golden Cheetah's json files.

Reading Golden Cheetah's JSON files is experimental.

Examples

Run this code
## Not run: 
# ## read raw data
# filepath <- system.file("extdata", "2013-06-08-090442.TCX", package = "trackeR")
# run <- readTCX(file = filepath, timezone = "GMT")
# 
# ## turn into trackeRdata object
# run <- trackeRdata(run, units = data.frame(variable = c("latitude", "longitude", 
#     "altitude", "distance", "heart.rate", "speed", "cadence", "power"),
#     unit = c("degree", "degree", "m", "m", "bpm", "m_per_s", "steps_per_min", "W"),
#     stringsAsFactors = FALSE))
# 
# ## alternatively
# run <- readContainer(filepath, type = "tcx", timezone = "GMT")
# ## End(Not run)

Run the code above in your browser using DataLab