forked from deephaven/deephaven-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update R6 class documentation in R Client (deephaven#3939)
* Update R6 class documentation * Create readme for the R client outline installation * Delete README.md * Apply suggestions from code review Co-authored-by: Chip Kent <5250374+chipkent@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: margaretkennedy <82049573+margaretkennedy@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: margaretkennedy <82049573+margaretkennedy@users.noreply.github.com> * Update client_options_wrapper docs * Update client_wrapper docs * Update table_handle_wrapper docs * Update Client.Rd * Update ClientOptions.Rd * Update TableHandle.Rd * Delete rdeephaven-package.Rd * Remove explicit methods from client_options_wrapper * Remove explicit methods from client_wrapper * Remove explicit methods from table_handle_wrapper * Add readme * Update README.md * Remove we/you from README * Apply suggestions from code review Co-authored-by: Chip Kent <5250374+chipkent@users.noreply.github.com> * Apply Chip's suggestions to README * Add instructions for git sparse-checkout * Remove redundancy * Apply suggestions from code review Co-authored-by: Chip Kent <5250374+chipkent@users.noreply.github.com> * More suggestions to README --------- Co-authored-by: Chip Kent <5250374+chipkent@users.noreply.github.com> Co-authored-by: margaretkennedy <82049573+margaretkennedy@users.noreply.github.com>
- Loading branch information
1 parent
2e90912
commit 96954d1
Showing
8 changed files
with
343 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# The Deephaven R Client | ||
|
||
The Deephaven R client is an R package that enables R users to interface with a Deephaven server and perform various | ||
server-side operations from the comfort of RStudio or any other R interface. | ||
|
||
## What can the R client do? | ||
|
||
The Deephaven Client currently provides three basic functionalities: | ||
|
||
1. Connect to a Deephaven server | ||
- with anonymous authentication (no username or password) | ||
- with basic authentication (username and password) | ||
- with custom authentication (general key-value credentials) | ||
|
||
2. Interface with Deephaven Tables on the server | ||
- Retrieve references to tables on the server | ||
- Pull table data into an [Arrow RecordBatchReader](https://arrow.apache.org/docs/r/reference/RecordBatchReader.html), | ||
an [Arrow Table](https://arrow.apache.org/docs/r/reference/Table.html), | ||
a [dplyr Tibble](https://tibble.tidyverse.org), | ||
or an [R Data Frame](https://stat.ethz.ch/R-manual/R-devel/library/base/html/data.frame.html) | ||
- Create new tables on the server from an [Arrow RecordBatchReader](https://arrow.apache.org/docs/r/reference/RecordBatchReader.html), | ||
an [Arrow Table](https://arrow.apache.org/docs/r/reference/Table.html), | ||
a [dplyr Tibble](https://tibble.tidyverse.org), | ||
or an [R Data Frame](https://stat.ethz.ch/R-manual/R-devel/library/base/html/data.frame.html) | ||
- Bind server-side tables to variable names, enabling access from outside the current R session | ||
|
||
3. Run scripts on the server | ||
- If the server is equipped with a console, run a script in that console | ||
- Currently, Python and Groovy are supported | ||
|
||
## Installation | ||
|
||
Currently, the R client is only supported on Ubuntu 20.04 or 22.04 and must be built from source. | ||
|
||
1. Choose a directory where the client source code will live. Here, the source code will be downloaded into a new directory called `deephaven`. | ||
Navigate into that directory and clone this subdirectory of `deephaven-core` using git's sparse-checkout: | ||
```bash | ||
mkdir deephaven | ||
cd deephaven | ||
git init | ||
git remote add -f origin https://github.com/deephaven/deephaven-core.git | ||
git config core.sparseCheckout true | ||
echo "R/rdeephaven" >> .git/info/sparse-checkout | ||
git pull origin main | ||
``` | ||
2. Now, navigate into the source code `lib` directory and build the C++ client and dependencies: | ||
```bash | ||
cd R/rdeephaven/lib | ||
chmod +x build-cpp.sh | ||
./build-cpp.sh | ||
``` | ||
3. With the C++ client installed, start an R console with this command: | ||
```bash | ||
R | ||
``` | ||
and in that console, install the client: | ||
```r | ||
install.packages("/path/to/rdeephaven", repos=NULL, type="source") | ||
``` | ||
This last command can also be executed from RStudio without the need for explicitly starting an R console. | ||
5. Now, run | ||
```r | ||
library(rdeephaven) | ||
``` | ||
in the R session, and start using the client! | ||
|
||
## High-level design overview | ||
|
||
The R client uses the | ||
[Deephaven C++ client](https://github.com/deephaven/deephaven-core/tree/main/cpp-client) | ||
as the backend for connecting to and communicating with the server. Any Deephaven-specific feature in the R client is, | ||
at some level, an API for an equivalent feature in the C++ client. | ||
To make Deephaven's C++ client API available in R, an R6 class provides an R interface to | ||
[Rcpp](https://github.com/RcppCore/Rcpp) wrapped parts of the C++ API. Deephaven's C++ API can create Arrow tables, and R has an [Arrow library](https://github.com/apache/arrow/tree/main/r). Because Arrow is an in-memory data format, Arrow data can be transferred between R and C++ simply by passing a pointer between the languages and using the | ||
[Arrow C Stream Interface](https://arrow.apache.org/docs/format/CStreamInterface.html). No data copies are required. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.