Description Usage Arguments Details Value References See Also Examples
View source: R/get_athlete_ids.R
Get information for athlete IDs that are available in the GoldenCheetah OpenData project and organize it in a gcod_db
object.
1 | get_athlete_ids(n_ids = Inf, mirror = "S3", prefix = NULL, ...)
|
n_ids |
integer indicating the maximum number of athlete IDs
to return. Default is |
mirror |
either |
prefix |
character string that limits the response to athlete
IDs that begin with it. Default is |
... |
further options to be passed to
|
mirror = OSF
currently returns an error and will be supported in future versions.
A list
also inheriting from class gcod_db
with components
remote_db
(the "remote perspective"; of class gcod_remote_db
)
and local_db
("the local perspective"; of class
gcod_local_db
). remote_db
and local_db
are data.frame
s,
also inheriting from classes gcod_remote_db
and gcod_local_db
,
respectively. local_db
has variables "path", "last_modified",
"size", "extracted", "downloaded", "athlete_id"m and remote_db
has variables "key", "last_modified", "e_tag", "size", "owner_id",
"owner_display_name", "storage_class", "bucket", and "athlete_id".
Liversedge, M. (2020). GoldenCheetah OpenData Project. OSF. https://doi.org/10.17605/OSF.IO/6HFPZ
print.gcod_db()
min_size.gcod_db()
max_size.gcod_db()
total_size.gcod_db()
mean_size.gcod_db()
n_ids.gcod_db()
remote_perspective.gcod_db()
local_perspective.gcod_db()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Get details for all available athlete IDs
ids <- get_athlete_ids()
## Print basic info for the IDs retrieved
print(ids, txtplot = TRUE)
## Extract basic info for the IDs retrieved
n_ids(ids, perspective = "remote")
n_ids(ids, perspective = "local")
format(min_size(ids, perspective = "local"), unit = "auto")
format(min_size(ids, perspective = "remote"), unit = "auto")
format(max_size(ids), unit = "auto")
format(mean_size(ids), unit = "auto")
format(total_size(ids), unit = "auto")
## remote_perspective(ids) and local_perspective(ids) inherit from
## data.frame` so we can easily do stuff like
## find which IDs have the minimum/maximum sizes
remote_ids <- remote_perspective(ids)
remote_ids[which.min(remote_ids$size), "athlete_id"]
## find all IDs with the string "007"
subset(athlete_id(ids), grepl("007", athlete_id(ids)))
## etc
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.