Permalink
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (19 sloc) 562 Bytes
library(rvest)
library(tidyverse)
# Scrape birth and death dates
page <- read_html("http://www.presidentsusa.net/birth.html")
life <-
page %>%
html_node(".table") %>%
html_table() %>%
as_data_frame()
names(life) <- c("president", "birth", "birth_loc", "death", "death_loc")
write_rds(life, "data/life.rds")
# Scrape term start and end dates
page <- read_html("http://historyinpieces.com/research/presidential-inauguration-dates")
term <-
page %>%
html_node("table") %>%
html_table() %>%
as_data_frame()
write_rds(term, "data/term.rds")