#str(japan) # Finish the code inside saveGIF library(tidyverse) library(animation) saveGIF({ # Loop through all time points for (i in 3:5) { # Subset japan: data data <- subset(mtcars, gear == i) # Finish the ggplot command p <- ggplot(data, aes(x = mpg, y = wt, width = 1)) + geom_point() + xlim(0, 30) + ylim(0, 5) + ggtitle(i) print(p) } }, movie.name = "pyramid.gif", interval = 1)