Description Usage Arguments Details Value References See Also Examples
View source: R/download_workouts.R
Download and, optionally, extract the workout archives the athlete IDs in the remote perspective of a gcod_id
object.
1 2 3 4 5 6 7 8 9 10 11 |
object |
a character string with the athlete ID or the first
few characters of that, or alternatively an object of class
|
local_dir |
the directory to download the workout archives for the selected athlete IDs. |
pattern |
character string containing a regular expression to
be matched with the athlete IDs in |
extract |
logical determining whether the workout files in the
downloaded archives should be extracted. Default is |
mirror |
either |
verbose |
logical determining whether progress information
should be printed. Default is |
confirm |
logical determining whether the user should be asked
whether they should continue with the download or not. Default
is |
overwrite |
logical determining whether existing archives with
the same names as the ones selected for download should be
overwritten. Default is |
... |
extra arguments to be passed to
|
If extract = TRUE
, then extract_workouts()
is called with clean_up = TRUE
and overwrite = TRUE
.
mirror = OSF
currently returns an error and will be supported in future versions.
If object
is a character string then a gcod_db
object is
return with corresponding remote and local perspective. If
object
is an object of class gcod_db
, then object
is
returned with the elements of local_perspective(object)$downloaded
set to
TRUE
or FALSE
depending on whether the corresponding workout
archives were downloaded successfully or not.
Liversedge, M. (2020). GoldenCheetah OpenData Project. OSF. https://doi.org/10.17605/OSF.IO/6HFPZ
get_athlete_ids()
extract_workouts()
1 2 3 4 5 6 7 8 9 10 | ## Using the first few letters of the athlete ID
if (interactive()) {
files_007_1 <- download_workouts("007", confirm = TRUE)
}
## Using a `gcod_db` object and fitering using regex
ids_00 <- get_athlete_ids(prefix = "00")
if (interactive()) {
files_007_2 <- download_workouts(ids_00, pattern = "007", confirm = TRUE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.