Richard Sprague

My personal website

Mercer Island local election results

Created: 2020-11-07 ; Updated: 2020-11-25

National and local news outlets report the results of the Presidential election at the state and county level, but that doesn’t tell me how my neighborhood voted. For that I’ll need the precinct-by-precinct results, which in my area is not reported. Can I calculate it myself? Here’s how.

First you obtain the full King County election results as a precinct-by-precint CSV file and read that into the variable election2020. Although preliminary precinct-level results are posted on election night, the analysis below uses the final numbers that were published November 24th.

Filter the results to look for just the Mercer Island precincts, and further narrow down to just the US Presidential results.

mercerIsland2020<- election2020 %>% dplyr::filter(grepl("M-I",as.character(Precinct))) %>% 
  select(Race,Precinct, CounterType, SumOfCount) %>% tibble()

mi.president.all<-dplyr::filter(mercerIsland2020,grepl("US",Race))   %>% 

mi.president.all %>% dplyr::filter(candidate!="Times Counted" &
                              candidate!="Registered Voters") %>%
  dplyr::group_by(candidate) %>% 
  dplyr::summarize(sum=sum(sum)) %>%
  dplyr::arrange(desc(sum)) %>%
  dplyr::mutate(pct=sum/sum(sum)*100) %>%
## `summarise()` ungrouping output (override with `.groups` argument)
candidate sum pct
Joseph R. Biden and Kamala D. Harris 11440 77.591
Donald J. Trump and Michael R. Pence 2888 19.588
Jo Jorgensen and Jeremy “Spike” Cohen 150 1.017
Write-in 112 0.760
Times Under Voted 103 0.699
Howie Hawkins and Angela Walker 26 0.176
Times Over Voted 22 0.149
Gloria La Riva and Sunil Freeman 2 0.014
Alyson Kennedy and Malcolm M. Jarrett 1 0.007

Top Candidates

Sometimes it’s nice to compare just among votes case for the “top candidates”, like this:

topCandidates<-c("Donald J. Trump and Michael R. Pence",
                 "Jo Jorgensen and Jeremy \"Spike\" Cohen",
                 "Joseph R. Biden and Kamala D. Harris")

mi.president<-mi.president.all %>% dplyr::filter(candidate %in% topCandidates)
mi.president$candidate<-factor(mi.president$candidate)<-mi.president %>% dplyr::group_by(candidate) %>%
  dplyr::summarize(sum=sum(sum)) %>%
  dplyr::arrange(desc(sum)) %>%
## `summarise()` ungrouping output (override with `.groups` argument)
candidate sum pct
Joseph R. Biden and Kamala D. Harris 11440 79.016
Donald J. Trump and Michael R. Pence 2888 19.948
Jo Jorgensen and Jeremy “Spike” Cohen 150 1.036

You can compare with the Mercer Island 2016 Results

and that’s it!