Skip to content
Prev 16833 / 63424 Next

Compiling R scripts

On Jul 4, 2005, at 6:31 AM, Uzuner, Tolga wrote:

            
1. Easier said than done. Much much easier said than done.
2. Move the bottleneck bits to C. Alternatively, I've found that for  
MCMC at least, employing R's lexical scoping features and using  
sapply to do the iteration can vastly improve performance (as well as  
improving your code's readability). If you're doing pure monte carlo  
the lexical scoping may not be of much help, but using something like  
sapply often helps. R is not C/C++/Java/Fortran and should not be  
programmed as such.
3. Look at the RDCOM stuff at www.omegahat.org.
Put all of that into an R package and then put the package into a  
local library location (i.e. one in your home directory). Unless  
something is odd, your home directory should be distributed to all  
nodes. Unless you're running a Windows cluster, at which point I have  
to ask... why?
---
Byron Ellis (ellis at stat.harvard.edu)
"Oook" -- The Librarian