Learn R Programming

dat (version 0.5.0)

verboseApply: Verbose apply function

Description

This apply function has a progress bar and enables computations in parallel. By default it is not verbose. As an interactive version with proper 'verbose' output by default please use vmap.

Usage

verboseApply(x, f, ..., .mc = 1, .mapper = mclapply, .bar = "none")

Arguments

x

(vector)

f

(function)

...

arguments passed to .mapper and hence f

.mc

(integer) the number of processes to start

.mapper

(function) the actual apply function used. Should have an argument mc.cores.

.bar

(character) one in 'none', '.' or 'bar'

Examples

Run this code
# NOT RUN {
verboseApply(
  1:4,
  function(...) Sys.sleep(1),
  .bar = "bar",
  .mc = 2 
)
# }

Run the code above in your browser using DataLab