powered by
Export a multi-layer raster (SpatRaster) or vector layer (sf) with multiple numeric value columns to an animated GIF.
SpatRaster
sf
to_gif( r, fps = 5, width = 600, height = 600, axes = TRUE, title_prefix = NULL, border = FALSE )
An animated magick image object (GIF).
SpatRaster or sf. A SpatRaster with multiple layers or an sf object with multiple numeric value columns.
numeric. Frames per second (default 5).
numeric. Width of output GIF in pixels.
numeric. Height of output GIF in pixels.
logical. Draw axes?
character or character vector.
character. Color of polygon border(s); using NA hides them. Only optional when r is an sf object.
r
sample_data <- terra::rast(system.file("extdata", "detroit_gs.tif", package = "greenSD")) gif <- to_gif(sample_data)
Run the code above in your browser using DataLab