View source: R/utils-javascript.R
glue_js | R Documentation |
Uses JavaScript notation to interpolate R variables into a string intended to be interpreted as JS.
glue_js(..., .open = "${", .envir = parent.frame())
... |
character vectors as the JavaScript source code (all arguments will be pasted into one character string) |
.open |
|
.envir |
|
This is a wrapper to glue::glue()
, but it uses the notation used by
JavaScript's template-literals,
${}
.
glue::glue()
object
x <- 123
glue_js("function(){return(${x});}") %>% print()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.