PackArgs: Packing arguments in function call

Description Usage Arguments Value Examples

Description

This is a helper function that can be handy when mapping function calls to multiple data. It wraps a function f, which accepts multiple arguments, into a new function that accept a vector as its argument.

Usage

1

Arguments

f

a function

...

other arguments passed to f

Value

a function that accepts a vector argument

Examples

1
2
3
4
5
ivpair <- c(10, 50)
resistance <- function(v, i) v / i
f <- PackArgs(resistance)
r1 <- resistance(ivpair[1], ivpair[2])
r2 <- f(ivpair)

Crystal-YWu/abftools documentation built on May 10, 2019, 8:22 a.m.