Determines the proposal number each variable corresponds to. In case no proposal number could be determined for a variable, NA_character is returned.
See also
Other variable-related functions:
add_vars_to_combos(),
is_skill_question_var(),
var_election_nr(),
var_lbl(),
var_lvls(),
var_prcd(),
var_skill_question_nr(),
var_title(),
var_val_set()
Examples
fokus::qstnrs |>
dplyr::mutate(proposal_nr = fokus::var_proposal_nr(variable_name)) |>
dplyr::filter(!is.na(proposal_nr)) |>
dplyr::select(variable_name, proposal_nr) |>
unique()
#> # A tibble: 181 × 2
#> variable_name proposal_nr
#> <chr> <int>
#> 1 voting_decision_federal_proposal_1 1
#> 2 voting_decision_federal_proposal_2 2
#> 3 voting_decision_federal_proposal_3 3
#> 4 voting_decision_cantonal_proposal_1 1
#> 5 importance_cantonal_proposal_1 1
#> 6 affectedness_cantonal_proposal_1 1
#> 7 main_motive_cantonal_proposal_1_yes 1
#> 8 main_motive_cantonal_proposal_1_no 1
#> 9 difficulty_cantonal_proposal_1 1
#> 10 decision_moment_cantonal_proposal_1 1
#> # ℹ 171 more rows