R Client Overview

The Deephaven Enterprise R client allows you to:

  • Create new workers
  • Interact with tables and objects on the server
  • Connect to existing Persistent Queries (PQs)
  • Create PQs
  • Run queries server-side
  • And more!

The Enterprise R client is built on top of the Community R client, giving you access to its rich feature set.

The Enterprise R client is very simple. For the basics of installing and using the Deephaven R client, see Develop an R Client Query in the Crash Course.

Built-in R documentation

You can get more information about the Deephaven R client by consulting the built-in R documentation.

In R, you can access the documentation for any function or package by using the ? operator. To do this, simply type ? followed by the name of the function or package you want to learn about. For example, if you want to get documentation on the mean function, you would type ?mean in the R console. This will open the help page for the mean function, providing detailed information about its usage, arguments, and examples.

Similarly, to access documentation for a specific package, you can type ?package_name. This method is a quick and efficient way to explore R's extensive built-in documentation and to gain a better understanding of the functions and packages you are using.

You can try this:

library("rdnd")
library("rdeephaven")

?rdnd
?rdeephaven
?SessionManager
?PqConfigBuilder
?DndClient
?Client
?Table

Additionally, you can use the ls method to list all the methods and fields on an object.

library("rdnd")
library("rdeephaven")

connection_json <- "https://host.mydomain.com:8000/iris/connection.json"

sm <- SessionManager$new(
        descriptive_name=paste0("R session manager pid=", Sys.getpid()),
        source=connection_json)

new_pq_name <- "my_new_pq"

pq_config_builder <- sm$make_temp_pq_config_builder(new_pq_name)
pq_config_builder.set_max_heap_size_gb(4);

session <- $sm$add_query_and_connect(pq_config_builder$build());

t <- session$historical_table("LearnDeephaven", "StockTrades")

ls(sm)
ls(pq_config_builder)
ls(session)
ls(t)