Mapping Election Results in Utah
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
My adopted home state of Utah has been a weird place this election cycle. For the unfamiliar, Utah is extremely conservative when it comes to politics; it is one of the reddest of the red states and has backed the Republican candidate for president for the past many decades. In 2012, about 3/4 of the popular vote went to Mitt Romney (who is LDS, like many here in the state) and there were no counties where Mitt Romney did not win.
The story during the 2016 election cycle has been very different, and well, kind of strange, if you ask me. For starters, Utah voters did not vote for the winning candidate in either party’s primary. Donald Trump is extremely unpopular here because his personality and values do not align with the typical Utah Republican. At the same time, Hillary Clinton is also quite unpopular here; the Clintons have just generally been unpopular here for a quarter decade with traditional Utah Republicans and she was not the first choice of Utah’s liberal voters. The winners of Utah’s primaries were Ted Cruz and Bernie Sanders. To complicate this situation, in the last weeks of our long, national nightmare that has been the 2016 campaign, Evan McMullin rose to some prominence as an independent candidate in Utah.
Utah isn’t particularly large or populous or really important, but it is where I live, so let’s look at the results of last Tuesday’s election!
Getting the data
Utah makes election results available online, but also Mike Kearney has gathered county-level election results for the U.S. and put it on GitHub. Let’s load the libraries I’ll use here, and then open the data that Mike has gathered.
What does this look like?
Counties in Utah have FIPS codes that start with 49.
There are 29 counties in Utah. Let’s just check to make sure they’re all here.
This is great. I would just like to say a big THANK YOU to Mike Kearney because this CSV is so well-formated and tidy!
Formatting the data for mapping
In election results, we see a lot of maps like this one, where each county is colored with who won and the color intensity scales with the margin by which the candidate won that county; these maps are great and communicate a certain kind of information. However, it seemed like Utah might be a three-way race (and you can see from that NYTimes link that McMullin did in fact get 20% of the vote here) so let’s try a different way of visualizing these results, just to get a different view.
I’m going to use Ari Lamstein’s choroplethr package for mapping the results. Ari has a lot of exciting stuff going on over at his website these days, with his free email course and a membership community. To use the data with the choroplethr package, I actually need to convert it to a wide, “un-tidy” format, so let’s work on that.
That will do it!
Making maps
Now let’s set up the code to make the maps. I will make one map for each candidate and then stitch them together, because I want to see how each candidate did across the state.
Gosh, as someone who lives here, it is so satisfying to see this set of maps. First of all, that county where Evan McMullin did the best is Utah County, Utah’s second most populous county and the seat of Brigham Young University. Hillary Clinton did well in Salt Lake County (the most populous county, where I live and the site of protests last night) and Summit County (where Park City and the ski resorts are); in fact, she won the popular vote in both of those counties. Donald Trump won the rest of the counties. Talk about your urban/rural divide right there. He won by enough overall that, as we know of course, he won the state’s electoral votes. Let’s make a plot of that, just for kicks.
These total numbers are a bit lower than what is currently being reported on Utah’s official election results website, but just proportionately a little lower overall. Utah’s election results won’t be officially certified until November 22.
This is a big change from 2012. Hillary Clinton did several percentage points better than Barack Obama; Utah is one of the few places where this is true. Trump’s showing around 45% of the vote is much, much worse (around 30 percentage points worse) than how Mitt Romney did here in 2012. It is perhaps not news that Trump is this unpopular here in Utah, and enough people still voted for him in this intensely Republican state for him to win the electoral votes.
What about total turnout?
This is more than 20% lower than the 2012 turnout; that is a BIG DROP! I do want to note that this number is lower than what is currently being reported on Utah’s official election results site so the total number of votes cast is higher than this. I’m not sure what the total number will eventually be once the vote is certified, but surely there are not 20% more votes still out there to be counted. Assuming there is a drop in turnout, I’m sure it reflects Utah’s unhappiness with both of the major party candidates. I am concerned, like many others, with problems with voter suppression and the gutting of the Voting Rights Act but I don’t think these were big issues in Utah. I think this is an issue of turnout and people not being excited to vote for either candidate.
The End
Politics has not been one of my life’s great passions, but I do care about my community and my neighbors and with that comes politics, I guess. I am an ex-academic with a PhD who has always lived in cities, so it is probably not a big shock to anybody that I am disappointed by the results of Tuesday’s election and concerned about what it means for our country. I am at a bit of a loss about what to say about all of that, to be honest, but I have appreciated the perspectives of other people on how we talk about this election, or maybe just the Onion. The R Markdown file used to make this blog post is available here. I am very happy to hear feedback or questions!
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.