TheEconomist / us-potus-model

Code for a dynamic multilevel Bayesian model to predict US presidential elections. Written in R and Stan.
https://projects.economist.com/us-2020-forecast/president
MIT License
1.24k stars 188 forks source link

CSV extract of polls has malformed dates #12

Closed conorotompkins closed 4 years ago

conorotompkins commented 4 years ago

The CSV extract of polls on https://projects.economist.com/us-2020-forecast/president contains malformed date values in start.date and end.date (specifically the year).

library(tidyverse)

polls <- read_csv("data/2020 US presidential election polls - all_polls.csv")

polls %>% 
  filter(start.date == "5/17/2002" | end.date %in% c("7/14/20220", "5/19/0220")) %>% 
  select(state, pollster, start.date, end.date)
# A tibble: 3 x 4
  state pollster      start.date end.date  
  <chr> <chr>         <chr>      <chr>     
1 FL    St Pete Polls 7/13/2020  7/14/20220
2 NY    Sinea College 5/17/2002  5/21/2020 
3 CA    SurveyUSA     5/18/2020  5/19/0220 
elliottmorris commented 4 years ago

Thanks and all fixed now.