0

I just begin with R. Usually I worked on Python but 1 step on my program require to run the Rscript, the package I loaded on that script takes a lot of time and it is reloaded everytime I run a new session on my python program. Does anyway for me to preload it when I start the python script so I don't need to reload all R packages on the script for the next running of the program? p/s: my program is on Windows and I run the R script through subprocess.call('path/to/Rscript.exe path/to/R script.R --some augments')

  • with each subprocess.call(), you are calling R as a whole new session. That's why on each runtime, it will preload everything as if you are just starting a new R session. – beavis11111 Feb 22 '21 at 13:13
  • thanks, so is there any alternative methods I can do to solve this problem? – khanhlpbao Feb 23 '21 at 03:27
  • try look into `tmux` or `nohup` command call; it may allow R session to be kept alive. Also checkout r support article on that too. – beavis11111 Feb 23 '21 at 10:53
  • https://stackoverflow.com/questions/39171338/running-r-in-the-background – beavis11111 Feb 23 '21 at 11:07

0 Answers0