Rebuilding the Dataset from Scratch

You almost certainly don’t need this. The published dataset is exactly what the steps below produce, and the R package and the interactive app are built on it. If you want a question the dataset doesn’t include, see Adding Variables from the Original Surveys, which doesn’t require rebuilding anything.

This page is for anyone who wants to reproduce the dataset for themselves: to download the original survey files, run our code, and confirm that every value in CVPA comes from those files the way our documentation says it does.

What can be rebuilt

The dataset combines 672 surveys. Nearly all of them are publicly archived on Borealis or Harvard Dataverse, and can be rebuilt by anyone. The 2026 Bridge Survey isn’t publicly archived yet, so our repository includes a minimal version of it: every respondent, but only the variables that appear in CVPA.

sourcesurveyscan be rebuilt?
Gallup Canada477yes
Canadian Election Study and Democracy Checkup27 filesyes
Environics Focus Canada134yes
Pollara Perspectives Canada44no: access is restricted to the Carleton University network
CVPA 2026 Bridge Survey1yes, from the minimal version in our repository

In total, the rebuild produces 628 of the 672 surveys: 9,081,938 of the dataset’s 9,198,156 rows. Only the Pollara surveys are missing. For those surveys, every row is identical to the published dataset. We last confirmed this, starting from an empty folder, in October 2026.

How the build works

The build code is in the code/ folder of our GitHub repository:

Two scripts in code/rebuild/ make the process automatic:

What you need

Step 1: Get the code

Download the repository from GitHub, either with git:

git clone https://github.com/lucasjacklucas/cvpa_dataset.git

or by clicking Code, then Download ZIP, on the repository page and unzipping it.

Step 2: Install the packages

In R:

install.packages(c("tidyverse", "haven", "arrow", "httr2"))

If you already have these packages, check that packageVersion("dplyr") is at least 1.2.0. If it isn’t, run install.packages("dplyr") and restart R.

Step 3: Run the rebuild

Open a terminal in the repository folder (the one containing code/ and dataset.parquet), and run:

Rscript code/rebuild/setup_rebuild.R "../cvpa_rebuild"

This creates a new folder called cvpa_rebuild next to the repository, downloads the survey files into it, and runs the build. You’ll see each file as it downloads, followed by the build’s progress and checks. The rebuilt dataset is written to cvpa_rebuild/3 Clean Data/dataset.parquet.

Two messages near the end are expected, and don’t mean anything went wrong:

If the run is interrupted, run the same command again. Files that have already downloaded are kept and not downloaded again.

Step 4: Compare with the published dataset

To check your rebuild against the published dataset, run this from the repository folder:

Rscript code/rebuild/compare_to_release.R "../cvpa_rebuild/3 Clean Data/dataset.parquet" "dataset.parquet"

The script reports how many surveys were rebuilt, lists the sources that couldn’t be, and then compares every row and column of the rebuilt surveys with the same surveys in the published dataset. It should finish with:

Every row of the rebuilt surveys is identical to the published dataset.

If you have access to the Pollara surveys

Members of the Carleton University community can download the Pollara surveys from Borealis while on the Carleton network. Put them in cvpa_rebuild/1 Raw Data/4 Pollara/surveys/, under the file names listed in code/rebuild/dataverse_files.csv, and run Step 3 again. The build will then include them.

Troubleshooting