Created
November 13, 2018 17:48
-
-
Save conjugateprior/94d0f5bfbe778832c5fedecf7d83e7f3 to your computer and use it in GitHub Desktop.
Hours-reversing NC counties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
page <- "https://www.newsobserver.com/news/politics-government/election/article100235752.html" | |
decreasers <- read_html(page) %>% # grab and parse the webpage | |
html_table %>% | |
pluck(1) %>% # first (and only) table | |
mutate(h2016 = parse_number(`2016 Hours`), # parse ugly number formats | |
h2012 = parse_number(`2012 Hours`), | |
County = toupper(County)) %>% | |
filter((h2016 - h2012) < 0) %>% | |
use_series(County) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment