1

I would like to know how can i make an animated ggplot map? I'm trying to build an COVID Visualization over-time.

To show you some example, here's a code of my own:

#Mortes

ggplot() +
  geom_sf(data=ontem, aes(fill=deaths), color="#FEBF57", size=.15, show.legend = TRUE) +
  labs(title = "Mortes por COVID",size=8) +
  scale_fill_distiller(palette = "BrBG",
                       name= "Mortes Confirmadas", limits=c(min(ontem$deaths),max(ontem$deaths)))+
  theme_void() + theme(plot.title = element_text(hjust = 0.5))

options(scipen=10000)

This code returns this map: enter image description here

I'd like to show the evolution of the COVID deaths over time. In the dataframe, there's a column named "date", which has the date time values like "2020-07-21".

  • 2
    There are many sources to help you. Here: https://stackoverflow.com/questions/60840971/creating-a-choropleth-map-with-us-county-level-data/60843261#60843261 and here: https://cran.r-project.org/web/packages/gganimate/gganimate.pdf#page=4 and here: https://stackoverflow.com/questions/49155038/how-to-save-frames-of-gif-created-using-gganimate-package – Edward Jul 22 '20 at 01:13
  • i keep getting this Error: Error in transform_sf(all_frames, states[[i]], ease, nframes[i], !!id, : transformr is required to tween sf layers – Matheus Barreto Alves Jul 22 '20 at 02:21

0 Answers0