get_round_idx {hubUtils} | R Documentation |
Utilities for accessing round ID metadata
get_round_idx(config_tasks, round_id)
get_round_ids(
config_tasks,
flatten = c("all", "model_task", "task_id", "none")
)
config_tasks |
a list version of the content's of a hub's |
round_id |
Character string. Round identifier. If the round is set to
|
flatten |
Character. Whether and how much to flatten output.
|
the integer index of the element in config_tasks$rounds
that a
character round identifier maps to
a list or character vector of hub round IDs
A character vector is returned only if flatten = "all"
A list is returned otherwise (see flatten
for more details)
get_round_idx()
: Get an integer index of the element in
config_tasks$rounds
that a character round identifier maps to.
get_round_ids()
: Get a list or character vector of hub round IDs.
For each round, if round_id_from_variable
is TRUE
, round IDs returned are
the values of the task ID defined in the round_id
property. Otherwise, if
round_id_from_variable
is FALSE
, the value of the round_id
property is
returned.
config_tasks <- read_config(
hub_path = system.file("testhubs/simple", package = "hubUtils")
)
# Get round IDs
get_round_ids(config_tasks)
get_round_ids(config_tasks, flatten = "model_task")
get_round_ids(config_tasks, flatten = "task_id")
get_round_ids(config_tasks, flatten = "none")
# Get round integer index using a round_id
get_round_idx(config_tasks, "2022-10-01")
get_round_idx(config_tasks, "2022-10-29")