Coder Social home page Coder Social logo

gl-yziquel / ocaml-r Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pveber/ocaml-r

0.0 0.0 0.0 1.79 MB

Objective Caml binding embedding the R interpreter

License: GNU General Public License v3.0

C 39.21% OCaml 57.23% R 0.22% CSS 2.65% Makefile 0.69%

ocaml-r's Introduction

OCaml-R: Objective Caml bindings for the R interpreter

OCaml-R is an Objective Caml binding embedding R's interpreter into OCaml code. It also provides bindings to R's standalone mathematical library, and has embryonic support for R's standard libraries.

It can be used to build R datastructures in memory, call R functions and convert the returned value to OCaml datastructures.

The API documentation is available online.

Installation

opam install ocaml-r

Library usage

Under utop:

# #require "ocaml-r.base";;
# open OCamlR_base;;
# Numeric.(of_list [3. ; 1. ; 4. ; 1. ; 5. ; 9.] |> print);;
[1] 3 1 4 1 5 9
- : unit = ()

To access functions from package foo, load ocaml-r.foo, e.g.:

# #require "ocaml-r.stats";;
# OCamlR_stats.rnorm 6 |> Numeric.print;;
[1]  0.17350351 -0.72756521  2.02369760 -0.77302094 -1.28523133  0.05172992
- : unit = ()

There are other packages. ocaml-r.math links to the standalone mathematical shared library of R. Other packages, such as R.base and R.stats are embryonic bindings of R's standard library. Help is very welcome on this side.

Authorship

OCaml-R was initially written by Maxence Guesdon. It was a rather simple binding that was used essentially by feeding strings to the R interpreter parser and evaluation function, and providing data conversion functions for simple R types. This was version 0.1 of OCaml-R.

Version 0.2, is essentially an almost complete rewrite by Guillaume Yziquel providing tight integration with the R library. It can dissect R values to expose their internal structures to OCaml (though this shouldn't be the most useful aspect, nor the recommended way to use this binding), it construct R calls by building up R values directly, integrates OCaml's and R's garbage collectors (though somewhat poorly), chains R exceptions back to Objective Caml, and provides static initialisation of the R interpreter.

Starting 2012, Philippe Veber took over the maintainance.

Copyright 2008-2010 INRIA - Maxence Guesdon. Contact: [email protected]

Copyright 2009-2010 Guillaume Yziquel. Contact: [email protected]

Copyright 2011-2018 Philippe Veber. Contact: [email protected]

Licenced under the GPL version 3.

ocaml-r's People

Contributors

drjdn avatar lefessan avatar pveber avatar yziquel 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.