xapply: Apply an expression over a list of "arguments"

xapplyR Documentation

Apply an expression over a list of "arguments"

Description

"applies" an expression (.) to a list of "arguments". Analogous to mapply but works with expressions rather than functions.
Examples:
mxapply(a+b, a=1:5, b=2:6)
mxapply(c(a+b, a-b), a=1:5, b=2:6)
mxapply(c(a+b, a-b), a=1:5, b=2:6, FUN=rbind)
mxapply(c(a+b, a-b), a=1:5, b=2:6, FUN=data.frame)

Usage

xapply(., ..., SIMPLIFY = TRUE, FUN = cbind)

Arguments

.

an expression

...

named args (must be named!)

SIMPLIFY

to return a simple vector or matrix if possible?

FUN

function to be called to simplify the result (e.g rbind, cbind, data.frame)

Value

a value


lebatsnok/hammock documentation built on Dec. 2, 2022, 6:25 a.m.