2

I have a run_stat.r script that can run in command line such as Rscript anova.r on my ubuntu server:

#load package   
library(ez)  
#run code....  

The problem is that the loading time of ez package would take 2~3 seconds.

Can R preload the package one time, so that it doesn't need to re-load the same package every time I run the script? Any suggestions to speed up the loading time of the package?

user213544
  • 2,046
  • 3
  • 22
  • 52
David.Z
  • 21
  • 1
  • This http://stackoverflow.com/questions/10300769/how-to-load-packages-in-r-automatically may help you. – Fernando Mar 21 '17 at 16:54
  • Thanks. But I've already seen this post. It just "auto-load" the package when R start. What I want is something like the "shared session". I'm not sure if R support something like this? – David.Z Mar 21 '17 at 17:00
  • 2
    How about this? http://stackoverflow.com/questions/41569997/is-it-possible-to-run-r-as-a-daemon – Dason Mar 21 '17 at 17:19

0 Answers0