Forum OpenACS Q&A: Response to Embedding R in Postgress

Posted by Andrew Piskorski on
Ulka, I have not heard of anyone taking Duncan Long's work Embedding R in Postgres and actually using it in a Production setting. But if you have, I'd be very interested! Please let us know what you find out...

You may want to ask if anyone has picked up Long's work on the R database special interest group mailing list. The list has almost no traffic, but some very high-powered R people (e.g., Brian D. Ripley) do subscribe and respond.

Also, back in October 2001, Roberto and Don pointed out that Long was probably mistaken in believing that R needs to be thread safe when embedded inside Postgres - it doesn't. On the other hand, if you instead wanted to embed R inside AOLserver, like others have done for Python, Java, Standard ML, and Perl, then it would need to be thread-safe.

If you can get R working reliably (perhaps it does already - I don't know) in either Postgres or AOLserver, or both, then you'll be able to use it nicely in an OpenACS environment. Once you do that, there's nothing particularly special about OpenACS that would either prevent or help you from using R however you want.

If your needs are simpler, you can always simply spawn R processes from Tcl (or perhaps even as CGI scripts). I haven't tried that with R (yet), but I've seen it done with S-Plus. S-Plus makes this slightly annoying because you have to do a bunch of setting of environemnt variables and stuff to play nice with S-Plus's "workspaces", but it's definitely practical if you just need to run some S calculations from Tcl.

By the way, Ulka, what sort of uses to you expect to put R to in your OpenACS environment? I'm curious...