library(tidyverse)
cand_dir <- usethis::use_zip(
"https://www.fec.gov/files/bulk-downloads/2020/cn20.zip",
destdir = tempdir(), cleanup = TRUE
)
cand_path <- fs::path(cand_dir, "cn.txt")
cand_names <- read_csv("https://www.fec.gov/files/bulk-downloads/data_dictionaries/cn_header_file.csv") %>%
names() %>%
tolower()
candidates <- read_delim(
cand_path,
col_names = cand_names,
delim = "|"
) %>%
filter(cand_election_yr %in% c(2019:2020))
usethis::use_data(candidates, overwrite = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.