Skip to contents

Adds one or more var_names to a combination list.

Usage

add_vars_to_combos(list, var_names)

Arguments

list

A list as returned by the combos_*() functions like combos_ballot_types().

var_names

A character vector of variable names.

Value

A list with list × var_names elements.

Examples

fokus::combos_proposals(ballot_date = "2023-06-18",
                        canton = "aargau",
                        incl_nr = FALSE) |>
  fokus::add_vars_to_combos(var_names = c("age_group", "favored_party"))
#> [[1]]
#> [[1]]$ballot_date
#> [1] "2023-06-18"
#> 
#> [[1]]$lvl
#> [1] "cantonal"
#> 
#> [[1]]$canton
#> [1] "aargau"
#> 
#> [[1]]$var_name
#> [1] "age_group"
#> 
#> 
#> [[2]]
#> [[2]]$ballot_date
#> [1] "2023-06-18"
#> 
#> [[2]]$lvl
#> [1] "cantonal"
#> 
#> [[2]]$canton
#> [1] "aargau"
#> 
#> [[2]]$var_name
#> [1] "favored_party"
#> 
#> 
#> [[3]]
#> [[3]]$ballot_date
#> [1] "2023-06-18"
#> 
#> [[3]]$lvl
#> [1] "federal"
#> 
#> [[3]]$canton
#> [1] "aargau"
#> 
#> [[3]]$var_name
#> [1] "age_group"
#> 
#> 
#> [[4]]
#> [[4]]$ballot_date
#> [1] "2023-06-18"
#> 
#> [[4]]$lvl
#> [1] "federal"
#> 
#> [[4]]$canton
#> [1] "aargau"
#> 
#> [[4]]$var_name
#> [1] "favored_party"
#> 
#>