download_pdf_codebook {ces} | R Documentation |
Download Canadian Election Study PDF Codebook
Description
This function downloads the official PDF codebook for a specified year of the Canadian Election Study. The codebook contains detailed information about all variables, question wording, response codes, and methodological details.
Usage
download_pdf_codebook(year, path = NULL, overwrite = FALSE, verbose = TRUE)
Arguments
year |
A character string indicating the year of the CES data. Available years include "1965", "1968", "1974-1980", "1984", "1988", "1993", "1997", "2000", "2004", "2006", "2008", "2011", "2015", "2019", "2021". |
path |
A character string indicating the directory where the codebook should be saved. If NULL (default), the codebook will be saved to the Downloads directory if available, otherwise to a temporary directory. |
overwrite |
Logical indicating whether to overwrite existing files. Default is FALSE. |
verbose |
Logical indicating whether to display detailed progress messages during download. Default is TRUE. |
Value
Invisibly returns the file path of the downloaded codebook.
Examples
# Download the 2019 CES codebook to a temporary directory
download_pdf_codebook("2019", path = tempdir())
# Download to a temporary directory
download_pdf_codebook("2015", path = tempdir())
# Overwrite existing file
download_pdf_codebook("2021", path = tempdir(), overwrite = TRUE)