Type: | Package |
Title: | 'Rock' R Server Client |
Description: | Connector to the REST API of a 'Rock' R server, to perform operations on a remote R server session, or administration tasks. See 'Rock' documentation at https://rockdoc.obiba.org/. |
Version: | 1.0.0 |
Depends: | R (≥ 3.1), httr |
Imports: | jsonlite, mime, progress |
Suggests: | knitr, testthat (≥ 3.0.0), tibble |
License: | MIT + file LICENSE |
LazyData: | true |
Encoding: | UTF-8 |
RoxygenNote: | 7.1.1 |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2021-03-11 14:57:42 UTC; yannick |
Author: | Yannick Marcon |
Maintainer: | Yannick Marcon <yannick.marcon@obiba.org> |
Repository: | CRAN |
Date/Publication: | 2021-03-12 14:00:02 UTC |
Constructs the value for the Bearer Authorization header
Description
Constructs the value for the Bearer Authorization header
Usage
.authorizationHeaderBearer(jwt)
Value
The header string
Constructs the value for the Opal Authorization header
Description
Constructs the value for the Opal Authorization header
Usage
.authorizationHeaderRockr(username, password)
Value
The header string
Turn expression into character strings.
Description
Turn expression into character strings.
Usage
.deparse(expr)
Value
The deparsed expression in a single string
Wrapper of httr::content()
Description
Wrapper of httr::content()
Usage
.getContent(conn, response)
Value
The response content object
Handle the file content.
Description
Handle the file content.
Usage
.handleAttachment(conn, response, disposition)
Value
The response content object
Handle the response content, unserialize when necessary.
Description
Handle the response content, unserialize when necessary.
Usage
.handleContent(conn, response)
Value
The response content object
Handle error response
Description
Handle error response
Usage
.handleError(conn, response)
Value
Always ends with a stop() call
Default request response handler.
Description
Default request response handler.
Usage
.handleResponse(conn, response)
Value
The response content object
Process response with default handler or the provided one
Description
Process response with default handler or the provided one
Usage
.handleResponseOrCallback(conn, response, callback = NULL)
Value
The response content object
Check connection is opened, calls stop() if it is not the case.
Description
Check connection is opened, calls stop() if it is not the case.
Usage
.is.opened(conn)
Value
Void
Verbose option
Description
Verbose option
Usage
.is.verbose()
Value
The verbose option logical value
Utility method to build urls. Concatenates all arguments and adds a '/' separator between each element
Description
Utility method to build urls. Concatenates all arguments and adds a '/' separator between each element
Usage
.url(conn, ...)
Value
The URL string
Verbose flag
Description
Verbose flag
Usage
.verbose()
Value
The same output as httr::verbose() or NULL
Assign an R expression or data
Description
Assign an R expression or R data to a symbol in the remote R session.
Usage
rockr.assign(conn, symbol, value, async = FALSE)
Arguments
conn |
A rockr connection object. |
symbol |
Name of the R symbol. |
value |
Value to assign to the symbol: can be a data value or a R script to execute. |
async |
R script is executed asynchronously within the session (default is FALSE). If TRUE, the value returned is the ID of the command to look for. |
Value
The command object if async is TRUE
See Also
Other assignment functions:
rockr.assign.data()
,
rockr.assign.expr()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.assign(conn, "mtcars", mtcars)
rockr.assign(conn, "x", 123)
rockr.assign(conn, "y", "abc")
rockr.assign(conn, "z", quote(tibble::tribble(
~colA, ~colB,
'a', 1,
'b', 2,
'c', 3
)))
rockr.close(conn)
## End(Not run)
Assign an R object
Description
Assign an R object to a R symbol in the remote R session.
Usage
rockr.assign.data(conn, symbol, value, async = FALSE)
Arguments
conn |
A rockr connection object. |
symbol |
Name of the R symbol. |
value |
The R object to assign (data.frame, vector, etc.). |
async |
R script is executed asynchronously within the session (default is FALSE). If TRUE, the value returned is the ID of the command to look for. |
Value
The command object if async is TRUE
See Also
Other assignment functions:
rockr.assign.expr()
,
rockr.assign()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
# push a data frame to the R server
rockr.assign.data(o, "D", mtcars)
# push a vector to the R server
rockr.assign.data(o, "C", mtcars$cyl)
# push a string
rockr.assign.data(o, "S", "Hello!")
## End(Not run)
Assign an R expression
Description
Assign an R expression to a symbol in the remote R session.
Usage
rockr.assign.expr(conn, symbol, value, async = FALSE)
Arguments
conn |
A rockr connection object. |
symbol |
Name of the R symbol. |
value |
Value to assign to the symbol: can be a primitive value or a R script to execute. |
async |
R script is executed asynchronously within the session (default is FALSE). If TRUE, the value returned is the ID of the command to look for. |
Value
The command object if async is TRUE
See Also
Other assignment functions:
rockr.assign.data()
,
rockr.assign()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.assign.expr(conn, "x", 123)
rockr.assign.expr(conn, "y", "abc")
rockr.assign.expr(conn, "z", quote(tibble::tribble(
~colA, ~colB,
'a', 1,
'b', 2,
'c', 3
)))
rockr.close(conn)
## End(Not run)
Close the R session
Description
Close the R session, if there is any associated to the connection.
Usage
rockr.close(conn)
Arguments
conn |
A rockr connection object. |
Value
Void
See Also
Other connection functions:
rockr.connect()
,
rockr.open()
Examples
## Not run:
conn <- rockr.connect('administrator','password', url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.close(conn)
## End(Not run)
Get an asynchronous command
Description
Get an asynchronous R commands in the remote R session.
Usage
rockr.command(conn, id, wait = FALSE)
Arguments
conn |
A rockr connection object. |
id |
R command ID. |
wait |
Wait for the command to complete. |
Value
The command object.
See Also
Other command functions:
rockr.command_result()
,
rockr.command_rm()
,
rockr.commands_rm()
,
rockr.commands()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.command(conn, '1234')
rockr.close(conn)
## End(Not run)
Get result of an asynchronous command
Description
Get the result of an asynchronous R commands in the remote R session. The command is removed from the remote R session after this call.
Usage
rockr.command_result(conn, id, wait = FALSE, rm = TRUE)
Arguments
conn |
A rockr connection object. |
id |
R command ID. |
wait |
Wait for the command to complete (default is FALSE). |
rm |
Remove command from the list of asynchronous commands after retrieving the result (default is TRUE). |
Value
The command result as an unserialized object.
See Also
Other command functions:
rockr.command_rm()
,
rockr.commands_rm()
,
rockr.commands()
,
rockr.command()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.command_result(conn, '1234')
rockr.close(conn)
## End(Not run)
Remove an asynchronous command
Description
Remove an asynchronous R commands in the remote R session.
Usage
rockr.command_rm(conn, id)
Arguments
conn |
A rockr connection object. |
id |
R command ID. |
Value
Void
See Also
Other command functions:
rockr.command_result()
,
rockr.commands_rm()
,
rockr.commands()
,
rockr.command()
Examples
## Not run:
conn <- rockr.connect('administrator','password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.command_rm(conn, '1234')
rockr.close(conn)
## End(Not run)
List the asynchronous commands
Description
Get the list of asynchronous R commands in the remote R session.
Usage
rockr.commands(conn, df = TRUE)
Arguments
conn |
A rockr connection object. |
df |
Return a data.frame (default is TRUE) |
Value
The data.frame of command objects, one column per property.
See Also
Other command functions:
rockr.command_result()
,
rockr.command_rm()
,
rockr.commands_rm()
,
rockr.command()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.commands(conn)
rockr.close(conn)
## End(Not run)
Remove all asynchronous commands
Description
Remove all asynchronous R commands in the remote R session.
Usage
rockr.commands_rm(conn)
Arguments
conn |
A rockr connection object. |
Value
Void
See Also
Other command functions:
rockr.command_result()
,
rockr.command_rm()
,
rockr.commands()
,
rockr.command()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.commands_rm(conn)
rockr.close(conn)
## End(Not run)
Rocker connection
Description
Connect with Rocker.
Usage
rockr.connect(
username = getOption("rock.username"),
password = getOption("rock.password"),
url = getOption("rock.url"),
opts = getOption("rock.opts", list())
)
Arguments
username |
User name in Rocker R server. Can be provided by "rock.username" option. |
password |
User password in Rocker R server. Can be provided by "rock.password" option. |
url |
Rocker R server url. Can be provided by "rock.url" option. |
opts |
Curl options as described by httr (call httr::httr_options() for details). Can be provided by "rock.opts" option. |
Value
A rockr connection object.
See Also
Other connection functions:
rockr.close()
,
rockr.open()
Examples
## Not run:
#### The below examples illustrate the different ways to connect to rockr ####
# explicit username/password connection
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
# explicit access token connection
conn <- rockr.connect(token='HYG16LO0VaX4O0UardNbiqmr2ByBpRke',
url='https://rocker-demo.obiba.org')
# connect using options and user credentials
options(rockr.username='administrator',
rockr.password='password',
rockr.url='https://rocker-demo.obiba.org')
conn <- rockr.connect()
# connect using options and personal access token
options(rockr.token='HYG16LO0VaX4O0UardNbiqmr2ByBpRke',
rockr.url='https://rocker-demo.obiba.org')
conn <- rockr.connect()
# connect using ssl key pair
options(rockr.opts=list(
sslcert='my-publickey.pem',
sslkey='my-privatekey.pem'))
conn <- rockr.connect(url='https://rocker-demo.obiba.org')
## End(Not run)
Generic REST resource deletion.
Description
Generic REST resource deletion.
Usage
rockr.delete(conn, ..., query = list(), callback = NULL)
Arguments
conn |
A rockr connection object. |
... |
Resource path segments. |
query |
Named list of query parameters. |
callback |
A callback function to handle the response object. |
Value
The response output object.
See Also
Other REST functions:
rockr.get()
,
rockr.post()
,
rockr.put()
Evaluate a R script
Description
Execute a R script in the remote R session.
Usage
rockr.eval(conn, script, json = FALSE, async = FALSE)
Arguments
conn |
A rockr connection object. |
script |
R script to execute. |
json |
Response is in JSON format or an object serialized by R. Default is FALSE. |
async |
R script is executed asynchronously within the session (default is FALSE). If TRUE, the value returned is the command object to look for. |
Value
The unserialized result object.
See Also
Other evaluation functions:
rockr.eval.source()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.eval(conn, "x <- 'foo'")
rockr.eval(conn, "ls()")
rockr.close(conn)
## End(Not run)
Evaluate a R file script
Description
Upload a R file script and execute it in the remote R session with source().
Usage
rockr.eval.source(conn, path, json = FALSE, async = FALSE)
Arguments
conn |
A rockr connection object. |
path |
Path to the R file script to execute. |
json |
Response is in JSON format or an object serialized by R. Default is FALSE. |
async |
R script is executed asynchronously within the session (default is FALSE). If TRUE, the value returned is the command object to look for. |
Value
The unserialized result object.
See Also
Other evaluation functions:
rockr.eval()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.eval.source(conn, "myscript.R")
rockr.close(conn)
## End(Not run)
Download a file
Description
Download a file or a folder from the Rocker R session working directory.
Usage
rockr.file_download(
conn,
source,
destination = NULL,
overwrite = FALSE,
temp = FALSE
)
Arguments
conn |
A rockr connection object. |
source |
Path to the file in the R server file system. |
destination |
Path to the file to be written. If omitted, file with same name in the working directory will be written. Any non-existing parent directories will be created. |
overwrite |
Overwrite the destination file if TRUE. Default is FALSE. |
temp |
Logical to specify whether the root folder is the R session's home or the temporary folder. Default is FALSE. |
Value
Void
See Also
Other file functions:
rockr.file_upload()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
# download a file
rockr.file_download(conn, 'data.csv')
# download, create destination folder and rename file
rockr.file_download(conn, 'DatabaseTest.sav', 'spss/test.sav')
rockr.close(conn)
## End(Not run)
Upload a file
Description
Upload a file into the Rocker R session working directory.
Usage
rockr.file_upload(
conn,
source,
destination = NULL,
overwrite = FALSE,
temp = FALSE
)
Arguments
conn |
A rockr connection object. |
source |
Path to the file in the local file system. |
destination |
Path of the destination file in the Rocker R session. Root folder is the session's home or temporary folder (see 'temp' parameter). If empty (default behavior), the destination file name will be the same as the source one. |
overwrite |
Overwrite the destination file if TRUE. Default is FALSE. |
temp |
Logical to specify whether the root folder is the R session's home or the temporary folder. Default is FALSE. |
Value
Void
See Also
Other file functions:
rockr.file_download()
Examples
## Not run:
conn <- rockr.connect(username='user', password='password',
url='https://rocker-demo.obiba.org')
rockr.open(conn)
# upload a file
rockr.file_upload(conn, 'data.csv')
# download, create destination folder and rename file
rockr.file_upload(conn, 'DatabaseTest.sav', '/spss/test.sav')
# upload a folder
rockr.file_upload(conn, 'input')
rockr.close(conn)
## End(Not run)
Generic REST resource getter.
Description
Generic REST resource getter.
Usage
rockr.get(
conn,
...,
query = list(),
acceptType = "application/octet-stream, application/json",
callback = NULL
)
Arguments
conn |
A rockr connection object. |
... |
Resource path segments. |
query |
Named list of query parameters. |
callback |
A callback function to handle the response object. |
Value
The response output object.
See Also
Other REST functions:
rockr.delete()
,
rockr.post()
,
rockr.put()
Log of the R server
Description
Get the tail of the R server log.
Usage
rockr.log(conn, limit = 100)
Arguments
conn |
A rockr connection object. |
limit |
The number of lines in the tail. |
Value
A vector of character strings, one per log file line.
See Also
Other administration functions:
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.log(conn, 10)
## End(Not run)
Open an R session
Description
Open a R session, and store the session object within the connection object.
Usage
rockr.open(conn)
Arguments
conn |
A rockr connection object. |
Value
Void
See Also
Other connection functions:
rockr.close()
,
rockr.connect()
Examples
## Not run:
conn <- rockr.connect('administrator','password', url='https://rocker-demo.obiba.org')
rockr.open(conn)
rockr.close(conn)
## End(Not run)
Package description from the R server
Description
Get the package description from the R server.
Usage
rockr.package(conn, name)
Arguments
conn |
A rockr connection object. |
name |
The package name. |
Value
The R package description object.
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.package(conn, 'tibble')
## End(Not run)
Install a package in the R server
Description
Install a package in the R server. Package can be in different kind of repositories: CRAN, GitHub or Bioconductor.
Usage
rockr.package_install(conn, name, ref = NULL, manager = "cran")
Arguments
conn |
A rockr connection object. |
name |
The package name or identifier in the source code repository. |
ref |
The branch/commit number of the source code repositories. |
manager |
The package manager: cran, github (gh), bioconductor (bioc). |
Value
Void
See Also
Other administration functions:
rockr.log()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.package_install(conn, 'tibble')
## End(Not run)
Remove a package from the R server
Description
Remove a package from the R server.
Usage
rockr.package_rm(conn, name)
Arguments
conn |
A rockr connection object. |
name |
The package name. |
Value
Void
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.package_rm(conn, 'tibble')
## End(Not run)
List of the packages in the R server
Description
Get the list of packages from the R server.
Usage
rockr.packages(conn)
Arguments
conn |
A rockr connection object. |
Value
The matrix of the R packages, same as the one from install.packages().
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.packages(conn)
## End(Not run)
List of the settings of the DataSHIELD packages
Description
Discover the list of DataSHIELD packages and their settings from the R server.
Usage
rockr.packages_datashield(conn)
Arguments
conn |
A rockr connection object. |
Value
The list of the DataSHIELD R packages properties (AggregateMethods, AssignMethods, Options)
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.packages_datashield(conn)
## End(Not run)
Remove some packages from the R server
Description
Remove some packages from the R server.
Usage
rockr.packages_rm(conn, names)
Arguments
conn |
A rockr connection object. |
names |
The package names. |
Value
Void
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.packages_rm(conn, c('rlang', 'tibble'))
## End(Not run)
Generic REST resource creation.
Description
Generic REST resource creation.
Usage
rockr.post(
conn,
...,
query = list(),
body = "",
contentType = "application/x-rscript",
acceptType = "application/octet-stream, application/json",
callback = NULL
)
Arguments
conn |
A rockr connection object. |
... |
Resource path segments. |
query |
Named list of query parameters. |
body |
The body of the request. |
contentType |
The type of the body content. Default is 'application/x-rscript'. |
acceptType |
The type of the body content. Default is 'application/octet-stream, application/json', i.e. a serialized R object or an error message. |
callback |
A callback function to handle the response object. |
Value
The response output object.
See Also
Other REST functions:
rockr.delete()
,
rockr.get()
,
rockr.put()
Generic REST resource update.
Description
Generic REST resource update.
Usage
rockr.put(
conn,
...,
query = list(),
body = "",
contentType = "application/json",
callback = NULL
)
Arguments
conn |
A rockr connection object. |
... |
Resource path segments. |
query |
Named list of query parameters. |
body |
The body of the request. |
contentType |
The type of the body content. Default is 'application/json'. |
callback |
A callback function to handle the response object. |
Value
The response output object.
See Also
Other REST functions:
rockr.delete()
,
rockr.get()
,
rockr.post()
Restart the R server
Description
Stop and start the R server. Any R sessions will be closed.
Usage
rockr.restart(conn)
Arguments
conn |
A rockr connection object. |
Value
Logical indicating wether the R server is running (invisible).
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.stop(conn)
## End(Not run)
Get a R session
Description
Get a specific R session. Users with administrator or manager role can get any R sessions. Regular users can only get their own.
Usage
rockr.session(conn, id)
Arguments
conn |
A rockr connection object. |
id |
The R session id to look for. |
Value
The R session object.
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.session(conn, '1234')
## End(Not run)
Switch R session
Description
Change the R session that is attached to the connection object. This allows to interact with a R session after another. Of course proper permission apply when executing R operations on this R session.
Usage
rockr.session_switch(conn, session)
Arguments
conn |
A rockr connection object. |
session |
A R session object. |
Value
Void
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
# open several R sessions
rockr.open(conn)
rockr.open(conn)
sessions <- rockr.sessions(conn)
# switch to first one
rockr.session_switch(conn, sessions[[1]])
conn$session
rockr.close(conn)
# switch to 2nd one
rockr.session_switch(conn, sessions[[2]])
conn$session
rockr.close(conn)
## End(Not run)
List of the R sessions
Description
Get the list of the R sessions. Users with administrator or manager role can list the R sessions. Regular users can only list their own.
Usage
rockr.sessions(conn, subject = NULL)
Arguments
conn |
A rockr connection object. |
subject |
Filter by subject name owning the sessions (requires administrator or manager role to be effective). |
Value
The list of the R session objects.
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.sessions(conn)
## End(Not run)
Start the R server
Description
Start the R server, if not already running.
Usage
rockr.start(conn)
Arguments
conn |
A rockr connection object. |
Value
Logical indicating wether the R server is running (invisible).
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.status()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.start(conn)
## End(Not run)
Status of the R server
Description
Get the status of the R server, including information about the server node.
Usage
rockr.status(conn)
Arguments
conn |
A rockr connection object. |
Value
The R server status object.
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.stop()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.status(conn)
## End(Not run)
Stop the R server
Description
Stop the R server, if running. Any R sessions will be closed.
Usage
rockr.stop(conn)
Arguments
conn |
A rockr connection object. |
Value
Logical indicating wether the R server is running (invisible).
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.version()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.stop(conn)
## End(Not run)
Version of the R server
Description
Get the version object of the R server.
Usage
rockr.version(conn)
Arguments
conn |
A rockr connection object. |
Value
A simple.list, same as R.version.
See Also
Other administration functions:
rockr.log()
,
rockr.package_install()
,
rockr.package_rm()
,
rockr.packages_datashield()
,
rockr.packages_rm()
,
rockr.packages()
,
rockr.package()
,
rockr.restart()
,
rockr.session_switch()
,
rockr.sessions()
,
rockr.session()
,
rockr.start()
,
rockr.status()
,
rockr.stop()
Examples
## Not run:
conn <- rockr.connect(username='administrator', password='password',
url='https://rocker-demo.obiba.org')
rockr.version(conn, 10)
## End(Not run)