get_ces {cesR}R Documentation

Create a dataframe object for a CES survey.


get_ces() creates a dataframe object for a requested Canadian Election Study survey using an associated survey code to call and download the survey dataset. On creation of the data object, prints out the associated citation for use with the requested dataset and a link to the original location of the data file.


get_ces(srvy, pos = 1)



A CES survey code call. See Survey Code Calls below. srvy value must be a character string.


Environment assignment. Defaults to 1, which is an assignment to the global environment.



Datasets are loaded using .dta, .sav, or .tab file types. See File Types below for a list of included CES datasets and their file type. To quickly convert a dataset's values to factor type use labelled::to_factor() on the dataset.

Survey Code Calls

File Types

Incorrect/Repeated Code Calls

Incorrect (a non-existent survey code) will stop the function process and return an associated error message. Repeated code calls will load in the raw version of the requested table.

Extra Notes

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.


The called srvy at the designated environment position pos. Default environment position is set to be the global environment.

See Also

get_cescodes() function help.


## Not run: 
# call the 2019 CES online survey

# convert variables to factor

# preview dataset

## End(Not run)

[Package cesR version 0.1.0 Index]