Description Usage Arguments Details Value References See Also Examples
View source: R/GoldenCheetahOpenData-package.R
Read the workout files, and wrangle and organize them into lists of
trackeR::trackeRdata
objects for further processing into the
trackeR
R package.
1 2 |
object |
an object of class |
verbose |
logical determining whether progress information
should be printed. Default is |
clean_db |
logical determining whether the workout
sub-directories should be deleted after processing. Default is
|
write_rds |
logical determining whether the processed
|
... |
other arguments to be passed to |
If any of local_perspective(object)$extracted
is FALSE
, then
the workout files are extracted automatically using
extract_workouts()
with overwirte = FALSE
and clean_up = FALSE
.
It is assumed that the filename for each workout corresponds to the timestamp where the first observation is made for the session. Timestamps are in UTC.
If the number of workout files in the archive of a particular athlete ID does not match the number of workouts recorded in the json files within that archive, then the workout files for the ID are not read.
A list of trackeR::trackeRdata
objects.
Frick, H., Kosmidis, I. (2017). trackeR: Infrastructure for Running and Cycling Data from GPS-Enabled Tracking Devices in R. Journal of Statistical Software, 82(7), 1–29. doi:10.18637/jss.v082.i07
trackeR::trackeRdata()
extract_workouts()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Get the two IDs starting with "000e" and "000d" and concatenate
## them into a single `gcod_db` object
ids000 <- lapply(c("000e", "000d"), function(x) get_athlete_ids(prefix = x))
ids000 <- c(ids000[[1]], ids000[[2]])
## Download the workout archives in tempdir()
ids000 <- download_workouts(ids000, verbose = TRUE, overwrite = TRUE)
## Read the workouts. This will create a list of two `trackeRdata`
## objects with 2 and 56 workouts
library("trackeR")
w000 <- read_workouts(ids000, clean_db = TRUE, verbose = TRUE)
## Now we can use methods from the trackeR R package
## Plot the workouts
plot(w000[[1]], what = "speed")
plot(w000[[2]], session = 1:5, what = c("speed", "heart_rate"))
## Compute concentration profiles for speed and power
cp <- concentration_profile(w000[[2]], what = c("speed", "power"))
plot(cp, multiple = TRUE)
## Get summaries for speed, power and work-to-rest ration
plot(summary(w000[[2]]), what = c("avgSpeed", "avgPower", "wrRatio"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.