call_fn_name

0th

Percentile

Extract function name of a call

Extract function name of a call

Usage
call_fn_name(call = NULL)
Arguments
call
Can be a call, a formula quoting a call in the right-hand side, or a frame object from which to extract the call expression. If not supplied, the calling frame is used.
Value

A string with the function name, or NULL if the function is anonymous.

See Also

call_fn()

Aliases
  • call_fn_name
Examples
# Extract the function name from quoted calls:
call_fn_name(~foo(bar))
call_fn_name(quote(foo(bar)))

# The calling expression is used as default:
foo <- function(bar) call_fn_name()
foo(bar)

# Namespaced calls are correctly handled:
call_fn_name(~base::matrix(baz))

# Anonymous and subsetted functions return NULL:
call_fn_name(~foo$bar())
call_fn_name(~foo[[bar]]())
call_fn_name(~foo()())
Documentation reproduced from package rlang, version 0.0.0.9000, License: GPL-3

Community examples

Looks like there are no examples yet.