Learn R Programming

rethinking (version 1.51)

mcreplicate: Multi-core version of replicate

Description

Uses the parallel library to distribute replicate processing across cores.

Usage

mcreplicate(n, expr, refresh = 0.1, mc.cores=2 )

Arguments

n

Number of replications

expr

Code to replicate

refresh

Status update refresh interval

mc.cores

Number of cores to use

Value

Details

This function uses mclapply to distribute replications across cores. It then simplifies the result to an array.

References

McElreath 2014, Statistical Rethinking.

See Also

mclapply, replicate