title: How to animate a map along the date?
body: <p>I have tried by myself but I don't know where is the mistake.</p>
  <p>I am trying to animate a Spanish province map with covid19 data. I can plot without any problem the map and the data from a chosen day, but I can't animate all the data along the time period.</p>
  <p>This is the .xml file <a href="https://drive.google.com/file/d/1krpITPZsBIwMGyNezfdw5kX1JsOWzT1P/view?usp=sharing" rel="nofollow noreferrer">xml file with the data</a></p>
  <p>This is the link to download the shape files: <a href="https://www.arcgis.com/home/item.html?id=83d81d9336c745fd839465beab885ab7" rel="nofollow noreferrer">shape files here</a></p>
  <p>and this is my code.</p>
  <pre><code>library(tidyverse)    
  library(rgdal)     
  library(broom)
  library(ggplot2)
  library(readxl)
  library(gganimate)
  
  setwd(&quot;C:/Users/...../Provincias_ETRS89_30N&quot;)
  
  carto_base &lt;- readOGR(&quot;Provincias_ETRS89_30N.shp&quot;)
  data_provincias &lt;- tidy(carto_base)
  
  dfprovincias &lt;- read_excel(&quot;provincias3.xls&quot;)
  dfprovincias$id &lt;- as.character(dfprovincias$id)
  dfprovincias$hospitalized_per_100000 = as.numeric(gsub(&quot;,&quot;, &quot;\\.&quot;,
                                                    dfprovincias$hospitalized_per_100000))
  dfprovincias$date &lt;- as.Date(dfprovincias$date, &quot;%y/%m/%d&quot;)
  
  dfprovincias_grafico &lt;- data_provincias %&gt;%
    left_join(dfprovincias, by= &quot;id&quot;)
  dfprovincias_grafico &lt;- na.omit(dfprovincias) 
  
  cols &lt;- RColorBrewer::brewer.pal(8,'Paired')[c(3,6)]
  
  dfprovincias_grafico %&gt;%
    #filter(date == &quot;2020-10-01&quot;)%&gt;% 
    ggplot(aes(x=long, y= lat, group = group)) +
    geom_polygon(aes(fill=hospitalized_per_100000), color= &quot;black&quot;, size = 0.2) +
    scale_fill_gradient(low=cols[1],high=cols[2]) +
    ggtitle(&quot;Hospitalizados por 100.000 habitantes en las provincias de España&quot;) +
    transition_reveal(date)
  </code></pre>