Description Usage Arguments Examples
Sends a variable to the server, where it is assigned to the variable with a specified name. A JavaScript function
jrc.sendData(variableName, variable)
can send data back from the server to the current R session.
1 | sendData(variableName, variable, keepAsVector = F)
|
variableName |
Name that the variable will have on the server. |
keepAsVector |
If TRUE, variables with length 1 will be saved as arrays on the server, otherwise they will be converted to atomic types |
data |
Variable to send |
1 2 3 4 5 6 | openPage()
x <- 1:100
sendData("x", x)
sendCommand("console.log(x);")
sendCommand("jrc.sendData('x', x.filter(function(e) {return e % 2 == 0}))")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.