Soft-deprecated: use qes_codebook(layout = "long"), which has one row per
value with its label and missing type. get_value_labels() keeps working
and will not be removed; it prints a one-time notice (see
qesR-deprecated).
Arguments
- codebook
A
qes_codebookobject fromqes_codebook().- variable
Optional variable name. If
NULL, returns mappings for all variables that have value labels.- long
If TRUE, return a long data frame with
variable,value, andvalue_labelcolumns.
Details
A variable that is not in the codebook is an error of class
qesR_error_unknown_variable that suggests near matches (qesR 0.4.4
returned an empty list). A label that is an empty string in the file is
kept as "".
See also
qes_codebook(), and qesR-deprecated for the legacy functions
and their replacements.
Other legacy:
download_codebook(),
format_codebook(),
get_codebook(),
get_codebook_files(),
get_decon(),
get_preview(),
get_qescodes(),
get_question()
Examples
cb <- qes_codebook("qes2014", variables = c("Q2", "Q19"))
get_value_labels(cb, "Q19")
#> `get_value_labels()` is soft-deprecated; use `qes_codebook(layout = "long")`. It keeps working and will not be removed.
#> $Q19
#> 1 2
#> "Oui" "Non"
#> 8 9
#> "Je ne sais pas" "Je préfère ne pas répondre"
#>