About

This library enables interoperability between R and D. The primary goal is to make it easy to pass data between the two languages. Some of the features provided by the library include:

  • Embed an R interpreter inside a D program.
  • Create a shared library with D functions that can be called from R.
  • Bindings to R API functions that allow a D program to allocate R data structures.
  • Bindings to R API functions that allow a D program to read and change data in R data structures.
  • Bindings to many R standalone math functions.

You can find the source, and file issues, at the Bitbucket repo. At this point the library has only been used on Linux, but there is no reason it can't be modified to work on other OSes. It's just a matter of someone with that expertise doing the work.

Likely the best alternative if you not using Linux is Docker. You can see my Docker setup, including a Dockerfile here. You should not need to make any changes to the Dockerfile, but you will need to make changes to the specification of directory names, as always.

There are other alternatives. If you are on Windows 10, you have Bash on Windows. You can use Virtualbox. You can use an RStudio Server instance running on a Digital Ocean server. All of these methods have been tested and there were no problems.

Contents

Installation
Usage: Calling R from D
Usage: Calling D from R
RMatrix
RVector
RList
NamedList
Strings
Conversions
Time series data
Printing
Sourcing R code
Miscellaneous operations
Error handling
Robj
Dealing with the R garbage collector
R math library constants and functions