papply: Parallel version of lapply

Description Usage Arguments Examples

Description

Detects and opens cores for simpler parallel lapply.

Usage

1
2
papply(X, FUN, ..., cores = 1, outfile = "", info.msg = NULL,
  end.msg = "", appendLF = TRUE, pb = TRUE)

Arguments

X, FUN, ...

See pblapply.

cores

An integer giving the number of cores to run the function FUN over.

outfile

Set this to FALSE to suppress printing from the cores.

info.msg

A message to print to the console, followed by the number of runs (and the number of cores in the case of parallel processing).

end.msg

A message to print to the consoleat the end of the processing.

appendLF

Used for the end.msg. If TRUE aappend a newline to the end message.

pb

Logical: If FALSE suppress the progress bar.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
f <- function(i){
	for(j in 1:3){
		for(k in 1:500){
			Sys.sleep(0.001)
			d <- runif(100)
		}
	}	
}
system.time(p <- papply(1:4, f, cores=1))
system.time(p <- papply(1:4, f, cores=2))

Sea2Data/Rstox documentation built on May 14, 2019, 8:58 a.m.