prgr: Title

Description Usage Arguments Examples

View source: R/progressio.R

Description

Title

Usage

1
prgr(fun, iterations)

Arguments

iterations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
shout <- function() Sys.sleep(0.1)

reps <- 100
shout <- prgr(shout, reps)

Sys.sleep(3)
replicate(reps, shout())

cl <- parallel::makeCluster(2)
fun <- function(x) {Sys.sleep(1); x}
system.time(
  parallel::parLapply(cl, 1:10, fun)
)

fun <- prgr(fun, iterations = 10)
system.time(
  parallel::clusterCall(cl, fun)
)

doParallel::registerDoParallel(cl)

foreach::`%do%`(foreach::foreach(1:10, .packages = "tcltk"), fun())

foreach::foreach()

nielsaka/charms documentation built on Sept. 3, 2019, 12:32 p.m.