vapplym: Memoizing wrapper for vapply.

View source: R/VectorizeM.R

vapplymR Documentation

Memoizing wrapper for vapply.

Description

Memoizing wrapper for vapply.

Usage

vapplym(X, FUN, FUN.VALUE, ..., USE.NAMES = TRUE)

Arguments

X

list or vector of inputs

FUN

function to apply

FUN.VALUE

type of vector to return

...

additional arguments passed to lapply

USE.NAMES

passed to vapply

Value

vector of results.

See Also

VectorizeM, lapplym

Examples


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))


wrapr documentation built on Aug. 20, 2023, 1:08 a.m.