powered by
Memoizing wrapper for vapply.
vapplym(X, FUN, FUN.VALUE, ..., USE.NAMES = TRUE)
vector of results.
list or vector of inputs
function to apply
type of vector to return
additional arguments passed to lapply
passed to vapply
VectorizeM, lapplym
VectorizeM
lapplym
fs <- function(x) { x <- x[[1]]; print(paste("see", x)); sin(x) } # should only print "see" twice, not 6 times vapplym(c(0, 1, 1, 0, 0, 1), fs, numeric(1))
Run the code above in your browser using DataLab