s <- rast(system.file("ex/logo.tif", package="terra"))
animate(s, n=1)
v <- vect(system.file("ex/lux.shp", package="terra"))
animate(v[1:3, ], n=1)
# animate(v, vars=names(v))
# you can save an animation to file like this
# animation::saveGIF(terra::animate(v), "animation.gif")
Run the code above in your browser using DataLab