glue_js {vegawidget} | R Documentation |
Interpolate into a JavaScript string
Description
Uses JavaScript notation to interpolate R variables into a string intended to be interpreted as JS.
Usage
glue_js(..., .open = "${", .envir = parent.frame())
Arguments
... |
character vectors as the JavaScript source code (all arguments will be pasted into one character string) |
.open |
|
.envir |
|
Details
This is a wrapper to glue::glue()
, but it uses the notation used by
JavaScript's template-literals,
${}
.
Value
glue::glue()
object
Examples
x <- 123
glue_js("function(){return(${x});}") %>% print()
[Package vegawidget version 0.5.0 Index]