The R side must be running the slRunRServer function.
Result object that might have a plot
property (giving a string that would work as the src
attribute of an img
element, representing graphics
drawn by the command) and a data
property (giving
the value returned by the command). If the promise resolves
to an error, the argument to the error function is a string
representing the cause of the error.
string
The R text to run. It can plot a graph
and/or return some R data structure (such as a data frame).
any
A javascript value that will be translated
to the R command as a value also called 'data'.
string
, HTMLElement
If provided, the
<img>
element (or id of the element) that will receive the
plot output (if any). The plot returned will be the size that this
element already has, so ensure that it is styled in a way that it has
the correct size even if no image (or an old image) has been set.
object
[optional] An object whose keys can be:
"imgType"
: Type of image required, "png"
(default) or "svg"
; "info"
: Function to be called
if the R function sendInfoText
is called;
"progress"
: Function to be called if the R function
sendProgress
is called.