Forum OpenACS Q&A: Re: PL/R for PostgreSQL

10: Re: PL/R for PostgreSQL (response to 9)
Posted by Cheng-Yi Hsu on
I have create a nsR.c module for aolserver with limit function, since R can compile as a share library, so I can provide loadable module for aolserver. Now I can call R function from tcl. I do not have enough resource to develop the module, if anyone feel interesting , you can take the source code an continue improve it. you can ferform function call like this:
set x [nsR log1p 1.5]
set x [nsR expml 2]
set x [nsR gamma 10]

11: Re: PL/R for PostgreSQL (response to 10)
Posted by Andrew Piskorski on
Cheng-Yi, that's interesting. I don't think I'll have the need or time to play with your nsR.c stuff anytime soon, but maybe you can upload it to file-storage or something in case others are interested?

Btw, what did you do about thread safety? Last I heard I thought R was not thread-safe, but maybe it is now?

12: Re: PL/R for PostgreSQL (response to 11)
Posted by Cheng-Yi Hsu on
In fact, what I do is just a POC, I follow the document Writing R Extensions and AOLserver C Module Example , R provide many numerical/stat function for C and FORTRAN program , maybe R was not thread-safe, but I "guess" the function call are thread-safe. This is the first step, what I need is pass a tcl list to nsR, and do some plotting job and return the image without fork a new R process.