Skip to contents

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.

Usage

get_round_ids_vec(config_tasks)

Arguments

config_tasks

List of Hub tasks, as the output of hubUtils::read_config() or the config_tasks attribute of a <hub_connection>.

Value

Unique round ids, as a vector.

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"