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.
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.
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
).
Here is a table of all the posts, data, and scripts in chronological order: