Learn R Programming

animate (version 0.3.9.4)

loop: Loop through the available frames n times

Description

Playback option for the functions rmd_animate and insert_animate.

Usage

loop(times = 1, wait = 20)

Arguments

times

An integer; the number of times to loop.

wait

A number; the number of milliseconds to wait for before the next frame is drawn.

Examples

Run this code
# \donttest{
input <- tempfile(fileext = ".Rmd")
output <- tempfile(fileext = ".html")
writeLines('
```{r, echo = FALSE, message = FALSE}
# Run / include the following in a code chunk of an R Markdown document
library(animate)
insert_animate(system.file("tests/Lorenz_system.json.gz", package = "animate"),
               options = loop(times = 2, wait = 15))
```
', input)
knitr::knit(input, output)
# browseURL(output)
# }

Run the code above in your browser using DataLab