MyNixOS website logo
Description

Access the Canadian Election Study Datasets.

Makes accessing and loading the Canadian Election Study (<http://www.ces-eec.ca/>, <https://ces-eec.arts.ubc.ca/>, <https://search1.odesi.ca/#/>) surveys into the R workspace more efficient by downloading a requested survey and loading it as a data object. This removes the need to locate, download, load, and change working directories when working with the Canadian Election Study surveys.

cesR

Access the Canadian Election Study Datasets.


Installation

You can install the current version of this package using:

devtools::install_github("hodgettsp/cesR")

Using the Package

The cesR package provides access to the CES Surveys through the use of a function call get_ces(srvy). Where variable srvy is an associated survey code entered as a character string. On a call, the cesR package will create a data object for the requested survey. Survey code calls can be found in the table provided below. On a call, the cesR package will additonally print out the citation for the called survey dataset. Additionally, it is possible to lookup the survey codes within the package through the function call get_cescodes(). This function requires no variables and prints out a data frame with the survey codes and associated calls. The resulting printed data frame provides survey call codes that can be copied and used with the get_ces() function to create a data frame for a requested survey. To access a preview of a particular dataset, use the get_preview(srvy, x) function. This function returns a preview of a CES survey dataset with a number of observations equal to a given numerical value in place of the variable x. If the variable x is not given the default of six observations will be returned. Lastly, the get_question(do, q) returns a CES survey question for a given data object and column name.

Examples

# install cesR package
devtools::install_github("hodgettsp/cesR")

# load cesR package
library(cesR)

# call ces survey call codes
get_cescodes()

>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"

# install cesR package
devtools::install_github("hodgettsp/cesR")

library(cesR)

get_preview("ces2019_web", 10)
cps19_StartDatecps19_EndDatecps19_ResponseIdcps19_consentcps19_citizensh~cps19_yobcps19_yob_2001_~cps19_gendercps19_provincecps19_educationcps19_demsatcps19_imp_iss
<dttm><dttm><chr><fct><fct><fct><fct><fct><fct><fct><fct>
<chr>
2019-09-13 08:09:442019-09-13 08:36:19R_1OpYXEFGzHRUp~I consent to~Canadian citizen1989NAA womanQuebecMaster’s degreeFairly sati~environment
2019-09-13 08:39:092019-09-13 08:57:06R_2qdrL3J618rxY~I consent to~Canadian citizen1998NAA womanQuebecMaster’s degreeDon’t know/~NA
2019-09-13 10:01:192019-09-13 10:27:29R_USWDAPcQEQiMm~I consent to~Canadian citizen2000NAA womanOntarioSome universityFairly sati~NA
2019-09-13 10:05:372019-09-13 10:50:53R_3IQaeDXy0tBzE~I consent to~Canadian citizen1998NAA manOntarioSome universityFairly sati~NA
2019-09-13 10:05:522019-09-13 10:32:53R_27WeMQ1asip2c~I consent to~Canadian citizen2000NAA womanOntarioCompleted seco~Fairly sati~NA
2019-09-13 10:10:202019-09-13 10:29:45R_3LiGZcCWJEcWV~I consent to~Canadian citizen1999NAA womanOntarioSome universityFairly sati~NA
2019-09-13 10:14:472019-09-13 10:32:32R_1Iu8R1UlYzVMy~I consent to~Permanent resid~1998NAA womanOntarioCompleted seco~Fairly sati~NA
2019-09-13 10:15:392019-09-13 10:30:59R_2EcS26hqrcVYl~I consent to~Canadian citizen1998NAA womanOntarioSome universityFairly sati~NA
2019-09-13 10:15:482019-09-13 10:37:45R_3yrt44wqQ1d4V~I consent to~Canadian citizen1998NAA womanOntarioSome universityFairly sati~NA
2019-09-13 10:16:082019-09-13 10:40:14R_10OBmXJyvn8fe~I consent to~Canadian citizen2000NAA manOntarioCompleted seco~Fairly sati~NA
# install cesR package
devtools::install_github("hodgettsp/cesR")

# load cesR package and labelled package
library(cesR)
library(labelled)

# call 2019 CES online survey
get_ces("ces2019_web")

# convert values to factor type
ces2019_web <- to_factor(ces2019_web)
head(ces2019_web)

# install cesR package
devtools::install_github("hodgettsp/cesR")

# load cesR package
library(cesR)

# call 2019 CES phone survey
get_ces("ces2019_phone")

# get question for q11 of 2019 CES phone survey
get_question("ces2019_phone", "q11")
>Which party will you likely to vote for

Details

The datasets are loaded in the labelled format. The variables can be quickly converted to a factor type by using the to_factor() function from the labelled package.

A survey can be called more than once and will replace the data object with an unaltered version of the survey.

All downloaded files and directories are removed with a call so that data files are not saved on your computer.


The cesR package also provides a non-exhaustive dataset consisting of 21 variables with renamed columns available with the function call get_decon().

The variables in this dataset have been converted to factors so that they display the actual values of the survey responses and not just the survey code responses.

The decon dataset consists of the following variables: * citizenship: Canadian citizenship status * yob: year of birth * gender: identified gender of the respondent * province_territory: Province or Territory of current residence * education: highest level of education completed * lr: united column of lr_bef and lr_aft values; whether the respondent identifies on the political spectrum * lr_bef: where the respondent identifies on the political spectrum; asked before party identification questions * lr_aft: where the respondent identifies on the political spectrum; asked after party identification questions * religion: religion of respondent * sexuality_selected: sexual identity * sexuality_text: sexual identity; written answers * language_eng: language learned as child and still understand; selected response English * language_fr: language learned as a child and still understand; selected response French * language_abgl: language learned as a child and still understand; specified Aboriginal language * employment: employment status * income: total household income, before taxes, for the year 2018 * income_cat: selected household income category * marital: marital status * econ_retro: response to question, ‘over the past year, has Canada’s economy:’ * econ_fed: response to question, ‘have the policies of the federal government made Canada’s economy…’ * econ_self: response to question, have the policies of the federal government made your financial situation…’

The get_decon() function uses no variables and will only run if the decon data object does not already exist.

Examples

devtools::install_github("hodgettsp/cesR")

library(cesR)

get_decon()
head(decon)
ces_codecitizenshipyobgenderprovince_territoryeducationlrlr_beflr_aftreligionsexuality_selectsexuality_textlanguage_englanguage_frlanguage_abgiemploymentincomeincome_catmaritalecon_retroecon_fedecon_self
ces2019_webCanadian citizen1989A womanQuebecMaster’s degree2NA2Don’t know/ Prefer not to answerPrefer not to sayNANANANADon’t know/ Prefer not to answerNADon’t know/ Prefer not to answerDon’t know/ Prefer not to answerStayed about the sameDon’t know/ Prefer not to answerDon’t know/ Prefer not to answer
ces2019_webCanadian citizen1998A womanQuebecMaster’s degree2NA2Catholic/ Roman Catholic/ RCPrefer not to sayNAEnglishFrenchNAStudent and working for payNADon’t know/ Prefer not to answerLiving with a partnerStayed about the sameNot made much differenceNot made much difference
ces2019_webCanadian citizen1998A manOntarioSome university77NAJewish/ Judaism/ Jewish OrthodoxHeterosexualNAEnglishNANAStudent and working for payNA$110,001 to $150,000Never MarriedGot worseWorseNot made much difference

Survey Code Table

yearcodenamecitationdocumentation
2019ces2019_web2019 CES Online surveysStephenson, Laura B; Harell, Allison; Rubenson, Daniel; Loewen, Peter John, 2020, “2019 Canadian Election Study - Online Survey”, https://doi.org/10.7910/DVN/DUS88V, Harvard Dataverse, V1 & Stephenson, Laura, Allison Harrel, Daniel Rubenson and Peter Loewen. Forthcoming. ‘Measuring Preferences and Behaviour in the 2019 Canadian Election Study,’ Canadian Journal of Political Science.CES 2019 Web
2019ces2019_phone2019 CES Phone SurveyStephenson, Laura B; Harell, Allison; Rubenson, Daniel; Loewen, Peter John, 2020, “2019 Canadian Election Study - Phone Survey”, https://doi.org/10.7910/DVN/8RHLG1, Harvard Dataverse, V1, UNF:6:eyR28qaoYlHj9qwPWZmmVQ== [fileUNF] & Stephenson, Laura, Allison Harrel, Daniel Rubenson and Peter Loewen. Forthcoming. ‘Measuring Preferences and Behaviour in the 2019 Canadian Election Study,’ Canadian Journal of Political Science.CES 2019 Phone
2015ces2015_web2015 CES Online SurveyFournier, Patrick, Fred Cutler, Stuart Soroka and Dietlind Stolle. 2015. The 2015 Canadian Election Study. [dataset]CES 2015 Combined
2015ces2015_phone2015 CES Phone SurveyFournier, Patrick, Fred Cutler, Stuart Soroka and Dietlind Stolle. 2015. The 2015 Canadian Election Study. [dataset]CPS Phone Clean; Mailback French; Mailback English; PES Phone Clean
2015ces2015_combo2015 CES Online/Phone SurveysFournier, Patrick, Fred Cutler, Stuart Soroka and Dietlind Stolle. 2015. The 2015 Canadian Election Study. [dataset]CES 2015 Combined
2011ces20112011 CES SurveyFournier, Patrick, Fred Cutler, Stuart Soroka and Dietlind Stolle. 2011. The 2011 Canadian Election Study. [dataset]2011 CPS Clean; 2011 MBS French; 2011 MBS English; 2011 PES Clean; 2011 Web Clean; 2011 Technical Documentation
2008ces20082008 CES SurveyGidengil, E, Everitt, J, Fournier, P and Nevitte, N. 2009. The 2008 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].CES 2008
2004ces20042004 CES SurveyBlais, A, Everitt, J, Fournier, P, Gidengil, E and Nevitte, N. 2005. The 2004 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].CES 2004
2004-2011ces04112004-2011 CES SurveyFournier, P, Stolle, D, Soroka, S, Cutler, F, Blais, A, Everitt, J, Gidengil, E and Nevitte, N. 2011. The 2004-2011 Merged Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].CES 2004; CES 2008; 2011 CPS Clean; 2011 MBS French; 2011 MBS English; 2011 PES Clean; 2011 Web Clean; 2011 Technical Documentation
2004-2006ces04062004-2006 CES SurveyBlais, A, Everitt, J, Fournier, P and Nevitte, N. 2011. The 2011 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].CES 2004-2006
2000ces20002000 CES SurveyBlais, A, Gidengil, E, Nadeau, R and Nevitte, N. 2001. The 2000 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].CES 2000
1997ces19971997 CES SurveyBlais, A, Gidengil, E, Nadeau, R and Nevitte, N. 1998. The 1997 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].CES 1997
1993ces19931993 CES SurveyBlais, A, Brady, H, Gidengil, E, Johnston, R and Nevitte, N. 1994. The 1993 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].CES 1993
1988ces19881988 CES SurveyJohnston, 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].CES 1988
1984ces19841984 CES SurveyLambert, R. D., Brown, S. D., Curtis, J. E., Kay, B. J. and Wilson, J. M. 1985. The 1984 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].CES 1984
1974ces19741974 CES SurveyClarke, H, Jenson, J, LeDuc, L and Pammett, J. 1975. The 1974 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].CES 1974
1974-1980ces74801974-1980 CES SurveyClarke, H, Jenson, J, LeDuc, L and Pammett, J. 1980. The 1974-1980 Merged Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].CES 1974-1980
1972 June-Julyces72_jnjl1972, June-July CES CurveyRuban, C. 1972. The 1972 Canadian Election Study [dataset]. 2nd ICPSR version. Toronto, Ontario, Canada: Market Opinion Research (Canada) Ltd. [producer], 1972. Ann Arbor, MI: Interuniversity Consortium for Political and Social Research [distributor], 2001.CES 1972 June-July
1972 Septemberces72_sep1972, September CES SurveyRuban, C. 1972. The 1972 Canadian Election Study [dataset]. 2nd ICPSR version. Toronto, Ontario, Canada: Market Opinion Research (Canada) Ltd. [producer], 1972. Ann Arbor, MI: Interuniversity Consortium for Political and Social Research [distributor], 2001.CES 1972 September
1972 Novemberces72_nov1972, November CES SurveyRuban, C. 1972. The 1972 Canadian Election Study [dataset]. 2nd ICPSR version. Toronto, Ontario, Canada: Market Opinion Research (Canada) Ltd. [producer], 1972. Ann Arbor, MI: Interuniversity Consortium for Political and Social Research [distributor], 2001.CES 1972 November
1968ces19681968 CES SurveyMeisel, J. 1968. The 1968 Canadian Election Study [dataset]. Inter-University Consortium for Political and Social Research, University of Michigan, Ann Arbor MI [Producer and distributor].CES 1968
1965ces19651965 CES SurveyConverse, P, Meisel, J, Pinard, M, Regenstreif, P and Schwartz, M. 1966. Canadian Election Survey, 1965. [Microdata File]. Inter-University Consortium for Political and Social Research, University of Michigan, Ann Arbor MI [Producer].CES 1965

Citations


  • ces2019_web: 2019 CES Online Survey

Citation Stephenson, Laura B; Harell, Allison; Rubenson, Daniel; Loewen, Peter John, 2020, “2019 Canadian Election Study - Online Survey”, https://doi.org/10.7910/DVN/DUS88V, Harvard Dataverse, V1

Documentation for the 2019 CES Online Survey can be accessed from here: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/DUS88V


  • ces2019_phone: 2019 CES Phone Survey

Citation: Stephenson, Laura B; Harell, Allison; Rubenson, Daniel; Loewen, Peter John, 2020, “2019 Canadian Election Study - Phone Survey”, https://doi.org/10.7910/DVN/8RHLG1, Harvard Dataverse, V1, UNF:6:eyR28qaoYlHj9qwPWZmmVQ== [fileUNF]

Documentation for the 2019 CES Phone Survey can be accessed from here: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/8RHLG1


  • ces2015_web: 2015 CES Online Survey

Citation: Fournier, Patrick, Fred Cutler, Stuart Soroka and Dietlind Stolle. 2015. The 2015 Canadian Election Study. [dataset]

Documentation for the 2015 CES Online Survey can be accessed from here: https://ces-eec.arts.ubc.ca/english-section/surveys/


  • ces2015_phone: 2015 CES Phone Survey

Citation: Fournier, Patrick, Fred Cutler, Stuart Soroka and Dietlind Stolle. 2015. The 2015 Canadian Election Study. [dataset]

Documentation for the 2015 CES Phone Survey can be accessed from here: https://ces-eec.arts.ubc.ca/english-section/surveys/


  • ces2015_combo: 2015 CES Online/Phone Surveys

Citation: Fournier, Patrick, Fred Cutler, Stuart Soroka and Dietlind Stolle. 2015. The 2015 Canadian Election Study. [dataset]

Documentation for the 2015 CES Online/Phone Surveys can be accessed from here: https://ces-eec.arts.ubc.ca/english-section/surveys/


  • ces2011: 2011 CES Survey

Citation: Fournier, Patrick, Fred Cutler, Stuart Soroka and Dietlind Stolle. 2011. The 2011 Canadian Election Study. [dataset]

Documentation for the 2011 CES Survey can be accessed from here: https://ces-eec.arts.ubc.ca/english-section/surveys/


  • ces2008: 2008 CES Survey

Citation: Gidengil, E, Everitt, J, Fournier, P and Nevitte, N. 2009. The 2008 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].


  • ces2004: 2004 CES Survey

Citation: Blais, A, Everitt, J, Fournier, P, Gidengil, E and Nevitte, N. 2005. The 2004 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].


  • ces0411: 2004-2011 CES Survey

Citation: Fournier, P, Stolle, D, Soroka, S, Cutler, F, Blais, A, Everitt, J, Gidengil, E and Nevitte, N. 2011. The 2004-2011 Merged Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].


  • ces0406: 2004-2006 CES Survey

Citation: Blais, A, Everitt, J, Fournier, P and Nevitte, N. 2011. The 2011 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].


  • ces2000: 2000 CES Survey

Citation: Blais, A, Gidengil, E, Nadeau, R and Nevitte, N. 2001. The 2000 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].


  • ces1997: 1997 CES Survey

Citation: Blais, A, Gidengil, E, Nadeau, R and Nevitte, N. 1998. The 1997 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].


  • ces1993: 1993 CES Survey

Citation: Blais, A, Brady, H, Gidengil, E, Johnston, R and Nevitte, N. 1994. The 1993 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].


  • ces1988: 1988 CES Survey

Citation: 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].


  • ces1984: 1984 CES Survey

Citation: Lambert, R. D., Brown, S. D., Curtis, J. E., Kay, B. J. and Wilson, J. M. 1985. The 1984 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].


  • ces1974: 1974 CES Survey

Citation: Clarke, H, Jenson, J, LeDuc, L and Pammett, J. 1975. The 1974 Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].


  • ces7480: 1974-1980 CES Survey

Citation: Clarke, H, Jenson, J, LeDuc, L and Pammett, J. 1980. The 1974-1980 Merged Canadian Election Study [dataset]. Toronto, Ontario, Canada: Institute for Social Research [producer and distributor].


  • ces72_jnjl: 1972, June-July CES Curvey

Citation: Ruban, C. 1972. The 1972 Canadian Election Study [dataset]. 2nd ICPSR version. Toronto, Ontario, Canada: Market Opinion Research (Canada) Ltd. [producer], 1972. Ann Arbor, MI: Interuniversity Consortium for Political and Social Research [distributor], 2001.


  • ces72_sep: 1972, September CES Survey

Citation: Ruban, C. 1972. The 1972 Canadian Election Study [dataset]. 2nd ICPSR version. Toronto, Ontario, Canada: Market Opinion Research (Canada) Ltd. [producer], 1972. Ann Arbor, MI: Interuniversity Consortium for Political and Social Research [distributor], 2001.


  • ces72_nov: 1972, November CES Survey

Citation: Ruban, C. 1972. The 1972 Canadian Election Study [dataset]. 2nd ICPSR version. Toronto, Ontario, Canada: Market Opinion Research (Canada) Ltd. [producer], 1972. Ann Arbor, MI: Interuniversity Consortium for Political and Social Research [distributor], 2001.


  • ces1968: 1968 CES Survey

Citation: Meisel, J. 1968. The 1968 Canadian Election Study [dataset]. Inter-University Consortium for Political and Social Research, University of Michigan, Ann Arbor MI [Producer and distributor].


  • ces1965: 1965 CES Survey

Citation: Converse, P, Meisel, J, Pinard, M, Regenstreif, P and Schwartz, M. 1966. Canadian Election Survey, 1965. [Microdata File]. Inter-University Consortium for Political and Social Research, University of Michigan, Ann Arbor MI [Producer].

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows