I am currently working as a Senior Data Scientist with Edge by Ascential (formerly Clavis Insight), a leading firm in eCommerce insights and analytics.
My work focuses on researching and implementing statistical and machine learning techniques in order to improve and automate processes within the company.



Tidy Tuesday is a weekly data project aimed at the R users. It is organised by the R4DS community.
It is a great way of practicing with differnt types of data and using different techniques. Wrangling, tidying, plotting and modelling different types of data.

One my latest attempt was in week 28 (09/10/2018), which was voter turnout data from 1980 to 2014 for the USA. It included the number of age-eligible voters versus total ballots/votes counted by state and year. I decided to try and use the gganimate library to create an animated plot.


Previous Weeks

Week 32 - US Turbine Data
Week 30 - Movie Data
Week 28 - US Voter Data
Week 5 - US Census Data


Week 28

The animation shows the number of elgible voters versus the number of votes over time.

Code

library(tidyverse)
library(gganimate)
library(scales)

 # Load data
voter_data <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2018-10-09/voter_turnout.csv")

 # Remove unwanted entries
state_data <- voter_data %>% 
  filter(!state %in% c("United States", "United States (Excl. Louisiana)"))

 # Create base plot for animation
votes_vs_eligible <- ggplot(state_data, aes(votes, eligible_voters, colour = state)) +
  geom_point(show.legend = FALSE) + theme_light() +
  scale_y_continuous(labels = comma_format()) +
  scale_x_continuous(labels = comma_format()) +
  labs(title = 'Eligible voters vs Number of votes', 
       subtitle = 'Year: {frame_time}',
       y = 'Eligible voters', x = 'Votes') +
  # extra lines needed for animation are below
  transition_time(year) +
  ease_aes('quartic-in-out')  # determines how points will move

animate(votes_vs_eligible, fps = 7.5)  # create the animation