lift_up: Change function to accept a packed vector as argument

Description Usage Arguments Value Author(s) Examples

Description

Similar to the family of lift functions in purrr. An example works better than an explanation, so please see below.

Usage

1
lift_up(f, up)

Arguments

f

a function

up

an unpacking method

Value

a function

Author(s)

Simon Barthelme

Examples

1
2
3
4
5
6
f <- function(a,b) a + b #A function of two arguments
l <- list(a= matrix(1:4,2,2),b = 5)
up <- gen.vunpack(l)
f.lifted <- lift_up(f,up)
f(l$a,l$b)
f.lifted(vpack(l))

dahtah/vecpack documentation built on May 14, 2019, 3:27 p.m.