Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

animate

Animate a SpatRaster


Description

Animate (sequentially plot) the layers of a SpatRaster to create a movie

Usage

## S4 method for signature 'SpatRaster'
animate(x, pause=0.25, main, range, maxcell=50000, n=1, ...)

Arguments

x

SpatRaster

pause

numeric. How long should be the pause be between layers?

main

title for each layer. If not supplied the z-value is used if available. Otherwise the names are used.

range

numeric vector of length 2. Range of values to plot

maxcell

integer > 0. Maximum number of cells to use for the plot. If maxcell < ncell(x), spatSample(type="regular") is used before plotting

n

integer > 0. Number of loops

...

Additional arguments passed to plot

Value

None

See Also

Examples

s <- rast(system.file("ex/logo.tif", package="terra"))   
animate(s, n=1)

terra

Spatial Data Analysis

v1.2-10
GPL (>= 3)
Authors
Robert J. Hijmans [cre, aut] (<https://orcid.org/0000-0001-5872-2872>), Roger Bivand [ctb] (<https://orcid.org/0000-0003-2392-6140>), Karl Forner [ctb], Jeroen Ooms [ctb] (<https://orcid.org/0000-0002-4035-0289>), Edzer Pebesma [ctb] (<https://orcid.org/0000-0001-8049-7069>)
Initial release
2021-05-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.