https://github.com/siel/rservex
Rservex communicates R with Elixir
https://github.com/siel/rservex
communication elixir r rserve
Last synced: 3 months ago
JSON representation
Rservex communicates R with Elixir
- Host: GitHub
- URL: https://github.com/siel/rservex
- Owner: Siel
- License: apache-2.0
- Created: 2019-03-21T03:24:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-27T22:29:26.000Z (over 5 years ago)
- Last Synced: 2025-02-10T00:41:34.942Z (5 months ago)
- Topics: communication, elixir, r, rserve
- Language: Elixir
- Size: 1.65 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rservex
`Rservex` is an under-development client for [Rserve](https://www.rforge.net/Rserve/index.html).
Aiming to enable the R <--> Elixir interoperation.`Rservex` is Heavily inspired in [Erserve](https://github.com/del/erserve)
## Current State
Currentle `Rservex` can:
- Create a connection
- Close a connection
- Send a command and receives str responses## Example
In R:
```r
library(Rserve)
Rserve()
```In Elixir:
```elixir
iex(1)> conn = Rservex.open()iex(2)> Rservex.eval(conn, "'Hello World'")
{:xt_arr_str, ["Hello World"]}iex(3)> Rservex.eval(conn, "c('Hello', 'World')")
{:xt_arr_str, ["Hello", "World"]}iex(4)> Rservex.eval(conn, "library(Pmetrics)")
{:xt_arr_str,
["rjson", "Pmetrics", "stats", "graphics", "grDevices", "utils", "datasets",
"methods", "base", ""]}
```## Installation
`rservex` is [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `rservex` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:rservex, "~> 0.1.2"}
]
end
```Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). The docs can
be found at [https://hexdocs.pm/rservex](https://hexdocs.pm/rservex).