get_preview()
creates a truncated dataframe for a requested Canadian Election Study
survey using an associated code to call and download
the survey dataset.
get_preview(srvy, obs = 6, pos = 1)
srvy | A CES survey code call. See Survey Code Calls below.
|
---|---|
obs | A numerical value that determines the number of observations returned.
If a value for |
pos | Environment assignment. Defaults to 1, which is an assignment to the global environment. |
The truncated version of the requested survey dataset srvy
with the set number of observations obs
to the designated environment pos
.
Datasets are loaded using either .dta or .sav file types
and converted to factor type using the to_factor()
function
from the labelled
package.
get_preview()
uses the same survey code calls as the get_ces()
function.
These survey code calls are listed below.
ces2019_web
calls 2019 CES online survey dataset.
ces2019_phone
calls 2019 CES phone survey dataset.
ces2015_web
calls 2015 CES online survey dataset.
ces2015_phone
calls 2015 CES phone survey dataset.
ces2015_combo
calls 2015 CES combined (online/phone) dataset.
ces2011
calls 2011 CES survey dataset.
ces2008
calls 2008 CES survey dataset.
ces2004
calls 2004 CES survey dataset.
ces0411
calls 2004-2011 CES survey dataset.
ces0406
calls 2004-2006 CES survey dataset.
ces2000
calls 2000 CES survey dataset.
ces1997
calls 1997 CES survey dataset.
ces1993
calls 1993 CES survey dataset.
ces1988
calls 1988 CES survey dataset.
ces1984
calls 1984 CES survey dataset.
ces1974
calls 1974 CES survey dataset.
ces7480
calls 1974-1980 CES survey dataset.
ces72_jnjl
calls 1972 June-July CES survey dataset.
ces72_sep
calls 1972 September CES survey dataset.
ces72_nov
calls 1972 November CES survey dataset.
ces1968
calls 1968 CES survey dataset.
ces1965
calls 1965 CES survey dataset.
Incorrect (a non-existent survey code) will stop the function process and return associated error messages. Repeated code calls will load in an unaltered version of the requested table.
Due to the naming of the columns in the 1965 and 1968 datasets it is recommended to download the associated codebook for the requested dataset.
get_ces()
function help.
get_cescodes()
function help.
if (FALSE) { # print out CES call codes get_cescodes() # call the 1993 CES dataset get_ces("ces1993") # preview the first 10 observations of the dataset get_preview("ces1993", 10) }