[R] slow R start up
Barry Rowlingson
B.Rowlingson at lancaster.ac.uk
Mon Nov 7 10:10:50 CET 2005
Some helpful person wrote:
> A possibility which might work, and if so would work as you intend,
> is to use a FIFO ("named pipe") or two to communicate with R.
>>>One possible solution may be to send the relevant commands to an
>>>already
>>>running copy of R but I've yet to figure out how to achieve this.
You could try one of the R server-based solutions:
http://franklin.imgen.bcm.tmc.edu/R.web.servers/
You could try Rserve, but you'll probably have to write some C++
wrapper so you can do a command from the shell, so you can do something
like:
echo "x=runif(1000);hist(x)" | RserveShell
from your shell script. Its probably only ten lines of C++.
http://stats.math.uni-augsburg.de/Rserve/doc.shtml
If you rewrite your script in Python, I may have some Python-Rserve
bindings working soon!
Do you need to get any of R's computational results back into your shell?
Whenever I write shell scripts, once it gets to about 20 lines I think
to myself "Uh oh, I shoulda written this in perl". And when I've written
200 lines of perl I find myself thinking "Uh oh, I shoulda written this
in Python".
Baz
More information about the R-help
mailing list