Wrapper of hubUtils::get_round_ids() that returns a
flat vector of unique round_id values regardless of whether
round_id_from_variable is TRUE or FALSE.
Arguments
- config_tasks
List of Hub tasks, as the output of
hubUtils::read_config()or theconfig_tasksattribute of a<hub_connection>.
Details
hubUtils::get_round_ids() with flatten = "all" returns a vector,
but may duplicate round_ids when round_id_from_variable: true.
hubUtils::get_round_ids() with flatten = "model_task" handles
both round_id_from_variable: true and round_id_from_variable: false,
but returns a list. This function provides a workaround by calling
purrr::list_c() on the output of hubUtils::get_round_ids() with
flatten = "model_task".
Examples
hub_con <- hubData::connect_hub(
system.file("testhubs/simple", package = "hubUtils")
)
config_tasks <- attr(hub_con, "config_tasks")
get_round_ids_vec(config_tasks)
#> [1] "2022-10-01" "2022-10-08" "2022-10-15" "2022-10-22" "2022-10-29"