A project using unsupervised machine learning to segment voters. This project was also featured on my blog here.
The data used for this project is the latest edition of the British Election Study (BES) panel survey. This data is stored as a Stata file (.dta) and to read into R you'll need to use functions from the haven package. Because of this, many of the fields in the data are labelled. As part of our data cleaning process we extract the labels from some of these fields and replace the values with these labels.
This project only used a small number of the variables as I felt it was the only fields that were necessary. Feel free to explore the data!
The Voter-Segmentation .html and .Rmd files contain all the code written for this project. The .Rmd file is the raw Rmarkdown document, while the .html file is the rendered version of the Rmd file.
This folder contains the html code for the two html widgets that are used in the article, as well as some accompanying JS code.
