Skip to content

A repo for analysis of political data in the R statistical programming language.

Notifications You must be signed in to change notification settings

elliottmorris/R-for-political-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 

Repository files navigation

R for Political Data Science

A repository to provide a central location for the files and data used in my weekly posts on analyzing political data in R. Inspired by the folks participating in Tidy Tuesday, I'm really intending this to be an introduction to techniques of data science that have real world applied use cases. Again, read more on my blog.

My DataCamp Course and R Package

If you're looking for a more guided introduction to the topic, consider taking my course "Analyzing Polling and Election Data in R" at DataCamp.com. And, of course, check out my R package politicaldata that makes downloading and analyzing a lot of these data even easier.

Housekeeping

An overview of this repository's files for the weekly posts detailed below:

  • The /data/ subdirectory is a list of all the data used in each post, cleaned up and ready to be imported.
  • The /scripts/ subdirectory contains scripts that analyze the datasets. These scripts are made of all the same code included in the posts, but the commentary is stripped away.

If your code doesn't work, make sure you've removed references to my personal R theme, theme_elliott(), which I suggest replacing with theme_minimal(). If you're still having trouble, open an issue with a reproducible example (which you can generate easily in R using reprex).

Data and posts

Here is a table of all the posts, data, and scripts in chronological order:

Date Data Script Post
2019-01-04 🔗 🔗 Polarization in the 115h Congress
2019-01-11 🔗 🔗 This Early Before 2020, It’s All About Name Recognition
2019-01-18 🔗 🔗 How Marginal Tax Rates Work
2019-01-25 🔗 🔗 What Happens To Our Algorithms When Socialists Vote in Congress
2019-02-01 🔗 🔗 The Ideological Diversity of the American Electorate
2019-02-08 🔗 🔗 Just How Liberal Are the 2020 Democratic Candidates?
2019-02-15 🔗 🔗 The 2020 Twitter Primary
2019-02-22 🔗 🔗 Four Parties in America? Probably Not Anytime Soon
2019-03-01 🔗 🔗 The "Strongest" Democrats and Republicans (That Ran for Office in 2018)
2019-03-08 🔗 🔗 What If Each State Allocated Their Electoral College Votes Proportionally?
2019-03-15 🔗 🔗 Beto O’Rourke is a Media Sweetheart
2019-03-22 🔗 🔗 Do Voters Still Care About The Economy?
2019-03-29 🔗 🔗 Is Media Coverage of the 2020 Democratic Primary Biased by Gender?
2019-04-05 🔗 🔗 How Old/Young Are The 2020 Democratic Candidates?
2019-04-12 🔗 🔗 The Mayor Pete Hype is Real
2019-04-19 🔗 🔗 How Loyal to Trump are Republican Voters?
2019-04-26
2019-05-03 🔗 🔗 The Yang Gang Came for Me. How Many of Them Are There?
2019-05-10 🔗 🔗 It Really Matters Which Polls An Aggregate Includes, and How

About

A repo for analysis of political data in the R statistical programming language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages