mcreadRDS: Multi-threaded readRDS

Description Usage Arguments Value See Also Examples

View source: R/my_functions.r View source: R/my_functions.r

Description

Uses the pigz utility to improve loading large R objects. This is compatible with saveRDS and readRDS functions. Requires pigz (sudo apt-get install pigz on Ubuntu).

Uses the pigz utility to improve loading large R objects. This is compatible with saveRDS and readRDS functions. Requires pigz (sudo apt-get install pigz on Ubuntu).

Usage

1
2
3
mcreadRDS(file, mc.cores = min(parallel::detectCores(), 4))

mcreadRDS(file, mc.cores = min(parallel::detectCores(), 4))

Arguments

file

The filename of the rds object.

mc.cores

How many cores to use in pigz. The program does not seem to benefit after more than about 4 cores.

file

The filename of the rds object.

mc.cores

How many cores to use in pigz. The program does not seem to benefit after more than about 4 cores.

Value

The R object.

The R object.

See Also

http://stackoverflow.com/questions/28927750/

http://stackoverflow.com/questions/28927750/

Examples

1
2
3
4
5
6
x <- sample(1e4, 1e7, replace=T)
saveRDS(x, file="temp.Rds")
xmc <- mcreadRDS("temp.Rds")
x <- sample(1e4, 1e7, replace=T)
saveRDS(x, file="temp.Rds")
xmc <- mcreadRDS("temp.Rds")

traversc/trqwe documentation built on Dec. 4, 2020, 4:21 a.m.