rcloud.install.js.module {rcloud.support} | R Documentation |
rcloud.install.js.module
creates a JavaScript module by
evaluating JavaScript code and returning bindings from R to
the module.
rcloud.install.js.module(module.name, module.content, force = FALSE)
module.name |
string, name of the module. Can be arbitrary but should be unique for each module. |
module.content |
JavaScript code sonstituting the module code on the JavaScript side - see Details below. |
force |
logical, if |
A JavaScript module is created by suppplying valid JavaScript code which evaluates into an object/dictionary. That dictionary is returned in R convering all JavaScript obejcts into R objects. JavaScript functions are returned as R functions invoking the corresponding JavaScript function they reference.
list of objects defined by the JavaScript code of the module
Gordon Woodhull, Simon Urbanek, Carlos Scheidegger
o <- rcloud.install.js.module("test",
"({ 'alert': function(x, k) { alert(x); k() } })")
o$alert("Module installed!")