speed

Parallel

Compiling

compiler example

library(compiler)
 
myFunction<-function() { 
   for(i in 1:10000000) {
       1*(1+1) 
   } 
}
myCompiledFunction <- cmpfun(myFunction) # Compiled function
system.time( myFunction() )
#   user  system elapsed 
# 10.002   0.014  10.021 
system.time( myCompiledFunction() )
# user  system elapsed 
# 0.692   0.008   0.700