Learn R Programming

OpenRepGrid (version 0.1.17)

sapply_pb: sapply with a progress bar

Description

Can be used like standard base:::sapply. The only thing it does is create an additional progress bar.

Usage

sapply_pb(X, FUN, ...)

Value

list see ?sapply

Arguments

X

see ?sapply for parameter explanation

FUN

see ?sapply

...

see ?sapply

See Also

Examples

Run this code
if (FALSE) {

l <- sapply(1:20000, function(x) list(rnorm(1000)))
head(sapply_pb(l, mean))

# performance comparison
l <- sapply(1:20000, function(x) list(rnorm(1000)))
system.time(sapply(l, mean))
system.time(sapply_pb(l, mean))
}

Run the code above in your browser using DataLab