openPage
creates a server and establishes a websocket connection between it and the current
R session. This allows commands exchange. In R use sendCommand
function to send and
execute JavaScript code on the server. On the server use jrc.sendCommand
function to send and
execute R code in the current R session.
openPage(useViewer = T, rootDirectory = NULL, startPage = NULL,
port = NULL, browser = getOption("browser"),
allowedFunctions = NULL, allowedVariables = NULL)
If TRUE
, the start page will be opened in the RStudio Viewer. If FALSE
a default web browser will be used.
A path to the root directory of the server. If rootDirectory
is not
defined, the http_root
in the package directory will be used as a root directory.
A path to the HTML file that should be opened, when the server is initialised.
This can be an absolute path to a local file, or it can be relative to the rootDirectory
or to the current R working directory. If startPage
is not defined, this function opens an
empty HTML page. The file must have .html extension.
Defines which TCP port to use for websocket connection. If not defined, random available port is used.
A browser in which the web page will be opened. Is used only if useViewer = FALSE
.
If not defined, default browser will be used. For more information check browseURL
.
List of functions that can be called from the web page without any additional actions
from the user. All other functions will require authorization in the current R session to be executed.
This should be a vector of function names. Check authorize
and allowFunctions
for more information.
List of variables that can be reassigned from the web page without any additional actions
from the user. All other reassignments will require authorization in the current R session to be executed.
This should be a vector of variable names. Check authorize
and allowVariables
for more information.
closePage
, setEnvironment
, limitStorage
, allowVariables
,
allowFunctions
.