wapply: List apply helper

Description Usage Arguments Author(s) Examples

View source: R/metaseqr.util.R

Description

A wrapper around normal and parallel apply (mclapply or multicore package) to avoid excessive coding for control of single or parallel code execution. Internal use.

Usage

1
    wapply(m, ...)

Arguments

m

a logical indicating whether to execute in parallel or not.

...

the rest arguments to lapply (or mclapply)

Author(s)

Panagiotis Moulos

Examples

1
2
3
4
5
6
7
multic <- check.parallel(0.8)
# Test meaningful only in machines where parallel computation 
# supported
if (multic) {
    system.time(r<-wapply(TRUE,1:10,function(x) runif(1e+6)))
    system.time(r<-wapply(FALSE,1:10,function(x) runif(1e+6)))
}

metaseqR documentation built on Nov. 8, 2020, 5:57 p.m.