The following functions can only be used inside Rserve, they cannot be
used in stand-alone R. They interact with special features of Rserve.
All commands below will succeed only if Rserve has been started with
r-control enable configuration setting for security reasons.
self.ctrlEval issues a control command to the Rserve parent
instance that evaluates the given expression in the server. The
expression is only queued for evaluation which will happen
asynchronously in the server (see
RSclient package for details). Note that the current session is
unaffected by the command.
self.ctrlSource issues a control command to the Rserve parent
instance to source the given file in the server, see
RSserverSource in the
RSclient package for details.
self.oobSend sends a out-of-band (OOB) message with the encoded
what to the client connected to this session. The
OOB facility must be enabled in the Rserve configuration (using
oob enable) and the client must support OOB messages for this
to be meaningful. This facility is not used by Rserve itself, it is
offered to specialized applications (e.g.
asynchronous notification of web clients using WebSockets-QAP1 tunnel
to dynamically update graphics on the web during evaluation).
self.oobMessage is like
self.oobSend except that it
waits for a response and returns the response.
self.ctrlEval(expr) self.ctrlSource(file) self.oobSend(what, code = 0L) self.oobMessage(what, code = 0L)
R expression to evaluate remotely
path to a file that will be sourced into the main instance
object to include as the payload fo the message
user-defined message code that will be ORed with the
oobMessage returns data contained in the response message.
All other functions return
## Not run: self.ctrlEval("a <- rnorm(10)") self.oobSend(list("url","http://foo/bar")) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.