I'd like to create a transition_reveal animation using gganimate whereby the title changes along the currently revealed iteration. So, the title at the start would be "Date: 2019-01-01" and then gradually adapt alongside the animation and finish by showing "Date: 2019-01-20".
a <- seq(1,20,1)
b <- seq(1,40,2)
c <- seq(as.Date("2019-01-01"), as.Date("2019-01-20"), by="days")
db <- cbind(a,b,c) %>% as.data.frame()
p <- ggplot(db, aes(x = a, y = b)) +
geom_path() +
labs(title = "Date: {frame_time}") +
transition_reveal(c)
animate(p, renderer = gifski_renderer(loop = FALSE), nframes = 90, fps = 30, height = 600, width = 1100, start_pause = 0)
Currently, I get the following error:
50: object 'fame_time' not found