Playback option for the functions rmd_animate and insert_animate.

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

# \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)
#> 
#> 
#> processing file: C:\Users\jkwok\AppData\Local\Temp\Rtmp65dS7Z\file7cc41e85bfc.Rmd
#> 
  |                                                          
  |                                                    |   0%
  |                                                          
  |.................                                   |  33%                  
  |                                                          
  |...................................                 |  67% (unnamed-chunk-1)
  |                                                          
  |....................................................| 100%                  
                                                                                                            
#> output file: C:\Users\jkwok\AppData\Local\Temp\Rtmp65dS7Z\file7cc443ad1290.html
#> [1] "C:\\Users\\jkwok\\AppData\\Local\\Temp\\Rtmp65dS7Z\\file7cc443ad1290.html"
# browseURL(output)
# }