I use the bigmemory package to put a very large matrix into shared memory (see script below, so it can be accessed in parallel by scripts in other R sessions.
I now want to execute the script in a non-interactive way. The problem is, that if I run it with Rscript, the matrix is removed from shared memory right after the Rscript process ended. I could add Sys.sleep(99999) to the end of the script, but I am wondering if there is any better way to acclompish this. Thanks for your help.
I use the
bigmemory
package to put a very large matrix into shared memory (see script below, so it can be accessed in parallel by scripts in other R sessions.I now want to execute the script in a non-interactive way. The problem is, that if I run it with
Rscript
, the matrix is removed from shared memory right after theRscript
process ended. I could addSys.sleep(99999)
to the end of the script, but I am wondering if there is any better way to acclompish this. Thanks for your help.