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 fun.

Value

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

See also

Examples

callAndName(is.finite, c(1, Inf, NA))
#> 1 Inf <NA> #> TRUE FALSE FALSE