Soft-deprecated: use qes_question(). get_question() keeps working and
will not be removed; it prints a one-time notice (see qesR-deprecated).
Arguments
- do
A data.frame, or the name of one, looked up (read only) in the calling environment and its enclosing environments: the workspace, for a call at top level or from a function or
sapply()lambda defined there.- q
Column name whose question text should be returned.
- full
Ignored: the full question text is always returned. Setting it to
FALSEprints a one-time note.
Value
A character scalar with question text, or NA_character_ (with a
warning of class qesR_warning) when none exists.
Details
q must name a column of the data exactly (ignoring case only when that
names a single column): get_question(d, "q1") never answers for q10.
An unknown name is an error of class qesR_error_unknown_variable that
suggests near matches. The text returned is the question of
qes_question() when the study is known, else the column's label; when
the source cut the question, a warning of class qesR_warning_truncated
says so. full no longer
changes the result: the text is always the most complete one qesR has.
See also
qes_question(), 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_value_labels()
Examples
demo <- get_qes("qes_demo", quiet = TRUE)
get_question(demo, "Q19")
#> `get_question()` is soft-deprecated; use `qes_question()`. It keeps working and will not be removed.
#> [1] "Si un référendum sur l’indépendance avait lieu vous demandant si vous voulez que le Québec devienne un pays indépendant, voteriez-vous OUI ou voteriez-vous NON?"