[ANN] RCall package for calling an embedded R from Julia

525 views
Skip to first unread message

Douglas Bates

unread,
Jan 14, 2015, 3:22:15 PM1/14/15
to julia...@googlegroups.com
RCall-v0.0.1 should soon be available.

It uses a native Julia interface to an embedded R.   Among other capabilities there is a dataset function to access datasets included with R packages.  For example,

attenu = dataset(:attenu)

creates a Julia DataFrame from the contents of the R attenu dataset in the datasets package.  To access data from a package that is not usually attached at startup you can use either

R.library("ggplot2")
diamonds = dataset(:diamonds)

or

diamonds = dataset("ggplot2::diamonds")

Sam Lendle

unread,
Jan 30, 2015, 5:45:34 PM1/30/15
to julia...@googlegroups.com
This looks great. Would it be possible to access an already running R session? Or is there currently a way of passing R objects to julia from R?

To avoid the XY problem, what I'm actually trying to do is call julia from R, passing to julia a data set from R, and getting results back into R. At this point what I'm planning to do is write a csv to a temp file in R, then call a julia script from R, then probably save results to a temp file or just print to STDOUT and deal with the rest in R. It's a bit tedious but it will work fine. If there is a better way to go about that I'm all hears though.

Douglas Bates

unread,
Feb 2, 2015, 11:10:44 AM2/2/15
to julia...@googlegroups.com
On Friday, January 30, 2015 at 4:45:34 PM UTC-6, Sam Lendle wrote:
This looks great. Would it be possible to access an already running R session? Or is there currently a way of passing R objects to julia from R?

I don't know how to attach an already running R session.  I expect it would be difficult to do. 

To avoid the XY problem, what I'm actually trying to do is call julia from R, passing to julia a data set from R, and getting results back into R. At this point what I'm planning to do is write a csv to a temp file in R, then call a julia script from R, then probably save results to a temp file or just print to STDOUT and deal with the rest in R. It's a bit tedious but it will work fine. If there is a better way to go about that I'm all hears though.

I have heard of an R package that calls Julia but I don't remember what it is called.  I would start by checking the list of packages on CRAN.  I don't think it is realistic to expect a Julia package to do the reverse calls.  If R is going to call Julia then the controlling code must be written in R or, more likely, in C/C++ using R's C API or Rcpp.  What we can try to do here is to enhance the mapping of R <-> Julia objects from the Julia side but the Julia package will always need to controlling process to be the Julia process.

Douglas Bates

unread,
Feb 3, 2015, 12:23:41 PM2/3/15
to julia...@googlegroups.com


On Monday, February 2, 2015 at 10:10:44 AM UTC-6, Douglas Bates wrote:
On Friday, January 30, 2015 at 4:45:34 PM UTC-6, Sam Lendle wrote:
This looks great. Would it be possible to access an already running R session? Or is there currently a way of passing R objects to julia from R?

I don't know how to attach an already running R session.  I expect it would be difficult to do. 

To avoid the XY problem, what I'm actually trying to do is call julia from R, passing to julia a data set from R, and getting results back into R. At this point what I'm planning to do is write a csv to a temp file in R, then call a julia script from R, then probably save results to a temp file or just print to STDOUT and deal with the rest in R. It's a bit tedious but it will work fine. If there is a better way to go about that I'm all hears though.

I have heard of an R package that calls Julia but I don't remember what it is called.

An R package to call Julia is https://github.com/armgong/RJulia 

I haven't used it myself.
Reply all
Reply to author
Forward
0 new messages