Calls a function and names the result with the first argument.

callAndName(fun, x, ...)

Arguments

fun

function.

x

The first input to fun.

...

Additional arguments passed to function defined in fun.

Value

The result of fun(x, ...), with the names given by the argument x.

Note

Updated 2019-07-29.

See also

Examples

callAndName(is.finite, c(1, Inf, NA))
#> 1.000000000000000e+00 Inf NA #> TRUE FALSE FALSE