This function fills the rplot.js glue-partial. The rplot javascript function is part of the OpenCPU javascript library.

rplot(id, rf, json, err = "Error: ")

Arguments

id

id of the corresponding html elements

rf

name of the R function

json

inner json of arguments to the R function

err

error message for the javascript alert

Value

java script code

Examples

appifyr:::rplot("xGkrZCuuI", "rnorm", "n : 5")
#> [1] "$(\"#submit-xGkrZCuuI\").click(function(){\r\n var req = $(\"#target-xGkrZCuuI\").rplot(\r\n \"rnorm\",\r\n {n : 5}\r\n );\r\n req.fail(function(){\r\n alert(\"Error: \" + req.responseText);\r\n });\r\n});\r"
appifyr:::rplot("xGkrZCuuI", "rnorm", "n : 1000, mean : 100, sd : 15")
#> [1] "$(\"#submit-xGkrZCuuI\").click(function(){\r\n var req = $(\"#target-xGkrZCuuI\").rplot(\r\n \"rnorm\",\r\n {n : 1000, mean : 100, sd : 15}\r\n );\r\n req.fail(function(){\r\n alert(\"Error: \" + req.responseText);\r\n });\r\n});\r"