What is OCaml-R ?

OCaml-R is a collection of libraries enabling OCaml code to access the functionalities of the R language and of its statistical computing environment.

OCaml-R is still in development, but should be quite usable. The API may undergo changes in the near or not so near future. Development effort now focuses on making binding of simple R libraries. Most of the R mathematical library functions are available. It is possible to evaluate R code, and import any R structure into OCaml. Design of OCaml-R allows static initialisation of R, which enables the users to wrap up and package R libraries into OCaml.

OCaml-R was initially written by Maxence Guesdon. Guillaume Yziquel rewrote it almost entirely for two reasons:

  • Easing the integration of OCaml-R with findlib and the Debian distribution ;
  • Leveraging the full power of the R API.

See the downloads section to get OCaml-R.

Then, follow the instructions in the INSTALL file coming with the distribution archive.

Debian packages are also available.


Here is a short guide to get started.

The library reference documentation is here.


OCaml-R is distributed under the GPL license.