create_codebook {ces}R Documentation

Create a Codebook for Canadian Election Study Dataset

Description

This function generates a comprehensive codebook for a CES dataset, including variable names, question labels, and response options.

Usage

create_codebook(data, include_values = TRUE, format = "tibble")

Arguments

data

A CES dataset, typically retrieved using get_ces().

include_values

Logical indicating whether to include response values in addition to labels. Default is TRUE.

format

A character string indicating the format to return the codebook in. Default is "tibble". Options include "tibble" or "data.frame".

Value

A tibble or data.frame containing the codebook with columns for variable name, question label, and response options.

Examples


# Get the 2019 CES data
ces_2019 <- get_ces("2019")

# Create a codebook
codebook <- create_codebook(ces_2019)

# View the first few entries
head(codebook)

# Create a codebook without values
codebook_simple <- create_codebook(ces_2019, include_values = FALSE)



[Package ces version 0.1.0 Index]