Description Usage Arguments See Also Examples
Uses the pigz utility to improve saving large R objects. This is compatible with saveRDS and readRDS functions. Requires pigz (sudo apt-get install pigz on Ubuntu).
1 | mcsaveRDS(object, file, mc.cores = min(parallel::detectCores(), 4))
|
object |
An r object to save. |
file |
The filename to save to. |
mc.cores |
How many cores to use in pigz. The program does not seem to benefit after more than about 4 cores. |
http://stackoverflow.com/questions/28927750/
1 2 3 4 5 6 7 8 | x <- sample(1e4, 1e7, replace=T)
y <- sample(1e4, 1e7, replace=T)
microbenchmark(mcsaveRDS(x, file="temp.Rds"), saveRDS(y, file="temp2.Rds")
Unit: seconds
expr min lq mean median uq
mcsaveRDS(x, file = "temp.Rds") 1.908310 1.908310 1.908310 1.908310 1.908310
saveRDS(y, file = "temp2.Rds") 6.271499 6.271499 6.271499 6.271499 6.271499
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.