Skip to content

Commit

Permalink
Actually add 2006, 2012
Browse files Browse the repository at this point in the history
  • Loading branch information
kuriwaki committed Sep 30, 2024
1 parent d249d2e commit 8134190
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions data-raw/create_dist-level-data_2006_2012.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ library(tidyverse)
library(googlesheets4)

# Authenticate with Google Sheets
gs4_auth()
# gs4_auth()

# URLs for your Google Sheets
url_2006 <- "https://docs.google.com/spreadsheets/d/1l7W130tPRF6dQ4JoqlQJSJexnEg4rZct-7kwDXqgoLE/edit?gid=429358610#gid=429358610"
Expand All @@ -17,7 +17,8 @@ cd_names_2006 <- read_sheet(url_2006, range = "A2:E", col_names = TRUE, sheet =

voting_info_2006 <- read_sheet(url_2006,range = "A2:I", col_names = TRUE, sheet = 2) |>
select(cd = CD,
pct_mccain = 'McCain%')
pct_mccain = 'McCain%',
presvotes_total = "Total")

# 2012
cd_names_2012 <- read_sheet(url_2012, range = "A2:G", col_names = TRUE, sheet = 1) |>
Expand All @@ -40,5 +41,5 @@ cd_info_2012 <- cd_names_2012 |>
mutate(cd = str_replace(cd, "-AL$", "-01"))

# Save the data
usethis::use_data(cd_info_2022, overwrite = TRUE)
usethis::use_data(cd_info_2024, overwrite = TRUE)
usethis::use_data(cd_info_2012, overwrite = TRUE)
usethis::use_data(cd_info_2006, overwrite = TRUE)
Binary file added data/cd_info_2006.rda
Binary file not shown.
Binary file added data/cd_info_2012.rda
Binary file not shown.

0 comments on commit 8134190

Please sign in to comment.