| preview | R Documentation |
Converts a stack of frames into an animated GIF for display, with each
frame's index and label overlaid as text. In an interactive session the
animation opens in the system viewer; in a knitr/Quarto document it is
embedded as an inline animated GIF. Wraps magick::image_animate.
preview(images, fps = 10, loop = 0, frames = NULL, label = TRUE)
images |
an object of class |
fps |
playback speed in frames per second. Must be a positive integer
divisor of 100, because GIF delay is stored in hundredths of a second
( |
loop |
a non-negative integer giving the number of times the animation
loops. |
frames |
integer vector of frame indices to duplicate. Defaults to
|
label |
logical. Whether to overlay the frame index and label on each
frame. Defaults to |
a magick-image object containing the animated sequence.
dino_dir <- system.file("extdata", package = "stopmotion")
images <- read(dir = dino_dir)
preview(images)
preview(images, fps = 5)
preview(images, label = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.