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. Any ideas?
library(bigmemory)
m = read.big.matrix("matrix.txt", type='double', shared = TRUE, header = FALSE, sep = "\t")
sign = describe(m)
dput(sign, "matrix.signature")
If you have the descriptor
signon disk, then you can just useattach.big.matrix()in another session: