Playback option for the functions rmd_animate and insert_animate.

click_to_loop(selector = "#SVG_1", start = 2, wait = 20)

Arguments

selector

The ID of the DOM element.

start

An integer; the number of frames to execute upon the beginning of the visualisation. This is useful when one wants to start with some set-up instead of an empty canvas.

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 = click_to_loop())
```
', input)
knitr::knit(input, output)
#> 
#> 
#> processing file: C:\Users\jkwok\AppData\Local\Temp\Rtmp65dS7Z\file7cc467603cca.Rmd
#> 
  |                                                          
  |                                                    |   0%
  |                                                          
  |.................                                   |  33%                  
  |                                                          
  |...................................                 |  67% (unnamed-chunk-1)
  |                                                          
  |....................................................| 100%                  
                                                                                                            
#> output file: C:\Users\jkwok\AppData\Local\Temp\Rtmp65dS7Z\file7cc438f574fd.html
#> [1] "C:\\Users\\jkwok\\AppData\\Local\\Temp\\Rtmp65dS7Z\\file7cc438f574fd.html"
# browseURL(output)
# }