title: Add dynamic text to gganimate's animation
body: <p>The code below animates a simple bar plot between two years. </p>
  
  <pre><code>library(tweenr)
  library(gganimate)
  library(tidyverse)
  
  df &lt;- tibble(
    decile = c("lowest", "second", "third", "lowest", "second", "third"),
    change = c(1, 2, -0.5, -2, -3, 4),
    year = c(2001L, 2001L, 2001L, 2002L, 2002L, 2002L)
  )
  
  df2001 &lt;- filter(df, year == 2001)
  df2002 &lt;- filter(df, year == 2002)
  
  ggplot(df2001, aes(x = decile, y = change)) +
    geom_col() +
    scale_y_continuous(limits = c(-5, 5)) +
    theme_minimal()
  
  ggplot(df2002, aes(x = decile, y = change)) +
    geom_col() +
    scale_y_continuous(limits = c(-5, 5)) +
    theme_minimal()
  
  a &lt;- ggplot(df, aes(x = decile, y = change/2, 
                      height = change, width = 0.9, group = decile)) +
    geom_tile() +
    scale_y_continuous(limits = c(-5, 5), name = "change") +
    theme_minimal(base_size = 26) +
    transition_states(year, wrap = FALSE, transition_length = 10, state_length = 1) +
    ease_aes("linear") +
    labs(title = "Year: {as.integer(frame_time)}")
  
  animate(a, fps = 10, duration = 5, width = 800, height = 600, start_pause = 15)
  </code></pre>
  
  <p>I would like to have text indicating which year is being shown. I thought the addition of:</p>
  
  <pre><code>+ labs(title = "Year: {as.integer(frame_time)}")
  </code></pre>
  
  <p>would work. However, it results in the error:</p>
  
  <blockquote>
    <p>Error in png::readPNG(frames[1], native = TRUE) :    unable to open
    /var/folders/46/jqbc50s140sgtrn9n3k8wppw0000gn/T//RtmpzhebyS/5da71995796d/gganim_plot0001.png
    In addition: There were 36 warnings (use warnings() to see them)</p>
  </blockquote>
  
  <p>warnings() yields:</p>
  
  <pre><code>Warning messages: 1: Cannot get dimensions of plot table. Plot region might not be fixed 
  2: object 'frame_time' not found 
  3: object 'frame_time' not found 
  4: object 'frame_time' not found 
  5: object 'frame_time' not found 
  </code></pre>
  
  <p>How do I dynamically display the year that corresponds with the current plot?</p>