Learn R Programming

assertive (version 0.2-1)

call_and_name: Call a function, and give the result names.

Description

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

Usage

call_and_name(fn, x, ...)

Arguments

fn
A function to call. See note below.
x
The first input to fn.
...
Optional additional inputs to fn.

Value

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

See Also

cause and na.

Examples

Run this code
call_and_name(is.finite, c(1, Inf, NA))

Run the code above in your browser using DataLab