I’m trying to animate a shapefile using gganimate, but when I run, nothing happens and R crashes. I’ve attached the code below, not sure what to do? Thanks.
ca_counties <- read_sf("California_County_Boundaries_5206538824092848308.geojson")
plot(st_geometry(ca_counties))
wnv_cases <- read_csv("wnv_ca.csv")
joined <- st_as_sf(full_join(wnv_cases, ca_counties, by = c("County" = "COUNTY_NAME")))
#joined
test_map <- ggplot() + geom_sf(data=joined %>% slice(1:150),
aes(fill=Cases)) +
theme_void()
test_animation <- test_map + transition_time(as.numeric(Year))
animate(test_animation)
Ran the animate command, expecting the plot to become animated in the plot pane, but R couldn’t complete it and I had to restart R to get it to stop running, and no plot showed up at all.
New contributor
baklava61 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.