Coder Social home page Coder Social logo

rashinban's Introduction

Rashinban

Rashinban is a Cloujure library designed to work with R. It is built on the Rserve library, and provides R functions by dynamically creating proxy functions into a Clojure namespace. It also converts automatically data types between Clojure and R when you invoke the proxy functions.

R-Rserve-Clojure

By using Rashinban, you will be easily able to use plentiful R functions from Clojure.

Requirements

  • Mac OS X 10.10
    • Rashinban has been developed on Max OS X 10.10.x. It should be able to run on other Unix-like operating systems.
  • R 3.2
  • Rserve 1.8

Before using Rashinban, you have to install R and Rserve into your local host settings.

Leiningen dependency information

Clojars Project

Usage

1. Start your Rserve server

Rashinban comes with a shell script to start a dedicated Rserve server. The shell command will then just be:

$ ./start-server.sh

2. Initialize the Rshinban library

tnoda.rashinban/init is the entry point to start Rashinban. It establishes a connection to the Rserve server and searches all available R functions to create Clojure proxy functions. The only thing you have to do is:

user> (require 'tnoda.rashinban :as r)
nil

user> (r/init)
nil

3. Use R functions by invoking thier Clojure proxy functions

tnoda.rashinban/init creates proxy functions for R functions into the tnoda.rashinban namespace. You can call R functions by prefixig r/ to their names. For example:

user> (r/sum (range 10))
[45.0]

user> (r/var (range 10))
[9.166666666666666]

Example

screenshot

Data type conversion between Clojure and R

Clojure Type R Type
nil NULL
symbol symbol
boolean logical vectors
string character vectors
seqable of doubles numeric vector
seqable of longs numeric vector

TODOs

https://github.com/tnoda/rashinban/wiki/Rashinban2Features

License

Copyright © 2015 Takahiro Noda

Distributed under the Apache License version 2.0.

rashinban's People

Contributors

tnoda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.