To help interface R from JS
install.packages("devtools")
library(devtools)
devtools::test() # it will ask you to install the required roxygen2 package
http://jsfiddle.net/dm89/6tsoscj8/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.