JS | R Documentation |
This function JS()
marks character vectors with a special class, so
that it will be treated as literal JavaScript code when evaluated on the
client-side.
JS(...)
... |
character vectors as the JavaScript source code (all arguments will be pasted into one character string) |
Yihui Xie
library(htmlwidgets)
JS('1 + 1')
list(x = JS('function(foo) {return foo;}'), y = 1:10)
JS('function(x) {', 'return x + 1;', '}')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.