Rock R

Build Status CRAN_Status_Badge

R implementation of the Rock R server REST API. Allows to interact with a remote R session in a stateful way.



# Make a connection object
conn <- rockr.connect('username', 'passwd', url = '')

# Get the status of the R server (admin only)

# Restart the remote R server (admin only)

# Open an R session

# Assign a R expression to a R symbol
rockr.assign(conn, 'x', 123)
rockr.assign(conn, 'y', 'hello')
rockr.assign(conn, 'z', quote(tibble::tribble(
  ~colA, ~colB,
  'a',   1,
  'b',   2,
  'c',   3

# Evaluate a R expression
rockr.eval(conn, quote(x))
rockr.eval(conn, quote(ls()))
rockr.eval(conn, call("ls"))

# Asynchronous assignment and evaluation
cmd <- rockr.eval(conn, quote(z), async = TRUE)
rockr.command_result(conn, cmd$id, wait = TRUE)

# File upload and download
rockr.file_upload(conn, source = "foo", destination = "/somedir/bar")
rockr.file_download(conn, source = "/somedir/bar", destination = "foo2")

# Terminate the remote R session