An animated GIF of the world rotating on its axis: a sequence of orthographic
globe_map() frames at evenly spaced central longitudes, assembled into a
looping animation with the optional gifski (preferred) or magick package.
Embeds directly in R Markdown / Quarto / a README.
Usage
spin_globe(
data,
fill,
lat = 20,
n_frames = 60,
fps = 15,
backend = c("polygon", "sf"),
width = 480,
height = 480,
file = NULL,
...
)Arguments
- data
A map-ready frame (see
globe_map()): a country-level frame withiso3cfor the"polygon"backend, or ansfframe for"sf".- fill
The fill column (unquoted).
- lat
The latitude the globe is tilted toward (the viewer's eye line).
- n_frames
Number of frames in one full 360 degrees rotation.
- fps
Frames per second of the output animation.
- backend
"polygon"(default; needsmaps+mapproj, nosf) or"sf".- width, height
Pixel dimensions of the animation.
- file
Optional output path (
.gif); a temporary file is used ifNULL.- ...
Passed to
globe_map()(e.g.fillstyle,palette).
