options(width=70) library(animatoR)
This is a short example to show how to embed animatoR
based animations
into Rmarkdown generated HTML file.
For embedding one can use the figure chunk option
fig.show='animate'
.
Option interval
controls the smoothness of
the replay.
Size is set by the option out.width
.
Here are the chunk options used for this example
{fig.show='animate',interval=0.01,results="asis"}
animator( "newplot();box();tpoints(2,2,8,8,cex=2,pch=16)" ,life=2)
(Note: chunk is not evaluated, can not set Travis-ci to use ffmpeg properly).
To view and run the animation, you have to open the HTML file in a browser.
sessionInfo() cat("Project path:`",dirname(getwd()),"`\\\\\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.