U.S. COVID-19 county level spread

Here is a polar-coordinated animation to follow day-to-day spread of COVID-19 across the U.S. counties. Each point is a county and colors indicate the state of the county. Data is provided here by New York Times in an ongoing repository on a daily basis.

urlfile="https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv"
df1 <- read_csv(url(urlfile))

g1 <- df1 %>%
  mutate(cal.date = as.Date(date,"%d%B%Y")) %>%
  arrange(state,county, cal.date) %>%
  group_by(state,county) %>%
  mutate(c.cases=cumsum(cases)) %>%
  ggplot(aes(y=cases,x=state, colour=state)) + 
  geom_point(alpha=0.9, size=1.5) + 
  scale_colour_hue(na.value = "black") + 
  coord_polar() + 
  scale_y_log10() +
  theme_fivethirtyeight() +
  theme(legend.position="none") + 
  theme(axis.text.x = element_text(
  angle= -90 - 360 / length(unique(df1$state)) * seq_along(df1$state)))  +
  labs(title = 'New COVID cases by county \n {frame_time}', x = ' ', y = '') +
  theme(legend.position = 'none') +
  transition_time(cal.date) +
  ease_aes('linear') 


animate(g1, height = 700, width =700)