call_fn

0th

Percentile

Extract function from a call

If a frame or formula, the function will be retrieved from the associated environment. Otherwise, it is looked up in the calling frame.

Usage
call_fn(call, env = caller_env())
Arguments
call

Can be a call or a quosure that wraps a call.

env

The environment where to find the definition of the function quoted in call in case call is not wrapped in a quosure.

Life cycle

In rlang 0.2.0, lang_fn() was soft-deprecated and renamed to call_fn(). See lifecycle section in call2() for more about this change.

See Also

call_name()

Aliases
  • call_fn
Examples
library(rlang) # NOT RUN { # Extract from a quoted call: call_fn(quote(matrix())) call_fn(quo(matrix())) # Extract the calling function test <- function() call_fn(call_frame()) test() # }
Documentation reproduced from package rlang, version 0.2.0, License: GPL-3

Community examples

Looks like there are no examples yet.