Skip to content

Siel/Rservex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rservex

Rservex is an under-development client for Rserve. Aiming to enable the R <--> Elixir interoperation.

Rservex is Heavily inspired in Erserve

Current State

Currentle Rservex can:

  • Create a connection
  • Close a connection
  • Send a command and receives str responses

Example

In R:

library(Rserve)
Rserve()

In 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, the package can be installed by adding rservex to your list of dependencies in mix.exs:

def deps do
  [
    {:rservex, "~> 0.1.2"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. The docs can be found at https://hexdocs.pm/rservex.

Releases

No releases published

Packages

No packages published

Languages