Determines the skill question number each variable corresponds to. In case no skill question 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_proposal_nr()
,
var_title()
,
var_val_set()
Examples
fokus::qstnrs |>
dplyr::mutate(skill_question_nr = fokus::var_skill_question_nr(variable_name)) |>
dplyr::filter(!is.na(skill_question_nr)) |>
dplyr::select(variable_name, skill_question_nr) |>
unique()
#> # A tibble: 52 × 2
#> variable_name skill_question_nr
#> <chr> <int>
#> 1 skill_question_1_cantonal_proposal_1 1
#> 2 skill_question_2_cantonal_proposal_1 2
#> 3 skill_question_3_cantonal_proposal_1 3
#> 4 skill_question_4_cantonal_proposal_1 4
#> 5 skill_question_5_cantonal_proposal_1 5
#> 6 passed_skill_question_1_cantonal_proposal_1 1
#> 7 passed_skill_question_2_cantonal_proposal_1 2
#> 8 passed_skill_question_3_cantonal_proposal_1 3
#> 9 passed_skill_question_4_cantonal_proposal_1 4
#> 10 passed_skill_question_5_cantonal_proposal_1 5
#> # ℹ 42 more rows