Skip to main content
Sunder Sai avatar

Sunder Sai has completed

Analyzing Election and Polling Data in R

Start course For Free
4 hr
4,650 XP
Statement of Accomplishment Badge

Loved by learners at thousands of companies


Course Description

This is an introductory course to the R programming language as applied in the context of political data analysis. In this course students learn how to wrangle, visualize, and model data with R by applying data science techniques to real-world political data such as public opinion polling and election results. The tools that you'll use in this course, from the dplyr, ggplot2, and choroplethr packages, among others, are staples of data science and can be used to analyze almost any dataset you get your hands on. Students will learn how to mutate columns and filter datasets, graph points and lines on charts, make maps, and create models to understand relationships between variables and predict the future. This course is suitable for anyone who already has downloaded R and knows the basics, like how to install packages.
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.
DataCamp for BusinessFor a bespoke solution book a demo.
  1. 1

    Presidential Job Approval Polls

    Free

    Chapter one uses a dataset of job approval polling for US presidents since Harry Truman to introduce you to data wrangling and visualization in the tidyverse.

    Play Chapter Now
    Introduction
    50 xp
    Selecting columns of data
    100 xp
    Filtering rows of data
    100 xp
    Averaging job approval by president
    50 xp
    Averaging approval ratings by president
    100 xp
    Averaging a column
    100 xp
    Visualizing Trump's approval over time
    50 xp
    Averaging president Trump's approval by month
    100 xp
    Calculating a rolling average of polls
    100 xp
    Visualizing Donald Trump's approval polls
    100 xp
    Bonus: Visualizing every president's approval
    100 xp
  2. 4

    Predicting the Future of Politics

    In this ensemble of applied statistics and data analysis, you will wrangle, visualize, and model polling and prediction data for two sets of very important US elections: the 2018 House midterms and 2020 presidential election.

    Play Chapter Now
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.

datasets

Brexit PollsBrexit ResultsGallup Approval PollsGeneric BallotUS Pres 2016 by County

collaborators

Collaborator's avatar
Chester Ismay
Collaborator's avatar
David Campos
Collaborator's avatar
Shon Inouye
G Elliott Morris HeadshotG Elliott Morris

Data Journalist

Elliott Morris is a data journalist who uses applied statistics and data science techniques with R to analyze, visualize, and model political (and other) data. Before he wrote articles and code professionally, he studied government, history, and computer science at the University of Texas at Austin. He shares his work frequently on Twitter (@gelliottmorris) and writes about data in politics at his blog, The Crosstab.
See More

Join over 17 million learners and start Analyzing Election and Polling Data in R today!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.