get_question() prints out the survey question associated with a given column in a given dataset name.

get_question(do, q)

Arguments

do

a CES survey data object (given as a character string)

q

a column name in a CES survey data object (given as a character string)

Value

The associated question q in a loaded dataset do.

Details

The order of the parameters for get_question are data object then column name. Both parameters must be character strings and cannot be reversed. To return the associated survey question, the get_question function relies on the var_label function from the labelled package.

See also

get_ces() function help. get_cescodes() help.

Examples

# print out CES code calls
get_cescodes()
#>    index ces_survey_code get_ces_call_char
#> 1      1     ces2019_web     "ces2019_web"
#> 2      2   ces2019_phone   "ces2019_phone"
#> 3      3     ces2015_web     "ces2015_web"
#> 4      4   ces2015_phone   "ces2015_phone"
#> 5      5   ces2015_combo   "ces2015_combo"
#> 6      6         ces2011         "ces2011"
#> 7      7         ces2008         "ces2008"
#> 8      8         ces2004         "ces2004"
#> 9      9         ces0411         "ces0411"
#> 10    10         ces0406         "ces0406"
#> 11    11         ces2000         "ces2000"
#> 12    12         ces1997         "ces1997"
#> 13    13         ces1993         "ces1993"
#> 14    14         ces1988         "ces1988"
#> 15    15         ces1984         "ces1984"
#> 16    16         ces1974         "ces1974"
#> 17    17         ces7480         "ces7480"
#> 18    18      ces72_jnjl      "ces72_jnjl"
#> 19    19       ces72_sep       "ces72_sep"
#> 20    20       ces72_nov       "ces72_nov"
#> 21    21         ces1968         "ces1968"
#> 22    22         ces1965         "ces1965"

# call CES survey
get_ces("ces1988")
#> TO CITE THIS SURVEY FILE: Johnston, R, Blais, A, Brady, H. E. and Crête, J. 1989. The 1988 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].
#> 
#> LINK:http://odesi2.scholarsportal.info/webview/index.jsp?v=2&submode=abstract&study=http%3A%2F%2F142.150.190.128%3A80%2Fobj%2FfStudy%2FCES-E-1988&mode=documentation&top=yes

# request the survey question for column a6
get_question("ces1988", "a6")
#> Saw Last TV Debate Among Party Leaders