get_round_idx {hubUtils} | R Documentation |
Utilities for accessing round ID metadata
Description
Utilities for accessing round ID metadata
Usage
get_round_idx(config_tasks, round_id)
get_round_ids(
config_tasks,
flatten = c("all", "model_task", "task_id", "none")
)
Arguments
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.
|
Value
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)
Functions
-
get_round_idx()
: Get an integer index of the element inconfig_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, ifround_id_from_variable
isTRUE
, round IDs returned are the values of the task ID defined in theround_id
property. Otherwise, ifround_id_from_variable
isFALSE
, the value of theround_id
property is returned.
Examples
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")