Interfacing Go and R

1,116 views
Skip to first unread message

ljw...@gmail.com

unread,
Apr 20, 2014, 11:30:22 AM4/20/14
to golan...@googlegroups.com
Is there a library or other preferred method for interfacing golang programs to R?  

(Sorry if this has been asked and answered elsewhere: R is the only programming language in the world harder to Google than Go. Googling them together is fun :)

Thanks.

Eric Gavaletz

unread,
Apr 21, 2014, 5:32:51 PM4/21/14
to golan...@googlegroups.com
Not that I know of. I looked a while back and didn't find anything so I ported my R code to Go (not for the faint of heart). The use of "CRAN" is probably highly correlated with the R programming language, and on the second page of results for the query "golang R CRAN" I found this:


It may not be what you need, but I hope this helps in your search. It does not look like there is much out there. Good luck.

Bill DeRose

unread,
Apr 21, 2014, 8:14:08 PM4/21/14
to golan...@googlegroups.com
fwiw I was doing some modeling this summer and wrote scripts in R and executed them from Go using os/exec. rjson makes it possible to encode your R objects in JSON which you can demarshall in Go. These may help:

http://godoc.org/launchpad.net/rjson

What exactly are you trying to do in R?

On Sunday, April 20, 2014 8:30:22 AM UTC-7, Larry wrote:

Dan Kortschak

unread,
Apr 21, 2014, 9:17:23 PM4/21/14
to Eric Gavaletz, golan...@googlegroups.com
I had a student start writing an Rserve interface for Go, but they found
other work. Rserve is likely to be a cleaner route to interoperation
with R. The start of that package is available if you want it (it's not
in a usable state yet).

Vedran Vekic

unread,
Apr 22, 2014, 4:04:43 AM4/22/14
to golan...@googlegroups.com, Eric Gavaletz
Where is said package available?

Volker Dobler

unread,
Apr 22, 2014, 4:31:54 AM4/22/14
to golan...@googlegroups.com
I am toying around with some kind of "table dumper" which
converts Go slices to R data frames. It is Go to R only but
works for me to plot Go produced data via ggplot2.
Intention was to open source it once I'm no longer
ashamed of API, code and documentation :-)

V.

Dan Kortschak

unread,
Apr 22, 2014, 5:14:11 AM4/22/14
to Vedran Vekic, golan...@googlegroups.com, Eric Gavaletz
Package is a very strong word. I can post you the code (I have it in an email) after I ask him if it's OK to let others see it. There are significant design decisions to be made in how type interchange operates between R and Go (Go does not natively support all R numeric values and how the interchange API should work is not immediately obvious - the java Rserve client may help designing this).
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vedran Vekic

unread,
Apr 22, 2014, 6:47:21 AM4/22/14
to golan...@googlegroups.com
I was looking to make a Go Rserve client, so it would probably be beneficial to see progress others made so far.
If there happens to be a possibility of seeing this code publicly, please let us know.
Reply all
Reply to author
Forward
0 new messages