Learn R Programming

wrapr (version 2.1.0)

lapplym: Memoizing wrapper for lapply.

Description

Memoizing wrapper for lapply.

Usage

lapplym(X, FUN, ...)

Value

list of results.

Arguments

X

list or vector of inputs

FUN

function to apply

...

additional arguments passed to lapply

See Also

VectorizeM, vapplym, parLapplyLBm

Examples

Run this code

fs <- function(x) { x <- x[[1]]; print(paste("see", x)); sin(x) }
# should only print "see" twice, not 6 times
lapplym(c(0, 1, 1, 0, 0, 1), fs)

Run the code above in your browser using DataLab