call_name

0th

Percentile

Extract function name of a call

Extract function name of a call

Usage
call_name(call)
Arguments
call

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

Value

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

Life cycle

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

See Also

call_fn()

Aliases
  • call_name
Examples
# NOT RUN {
# Extract the function name from quoted calls:
call_name(quote(foo(bar)))
call_name(quo(foo(bar)))

# Or from a frame:
foo <- function(bar) call_name(call_frame())
foo(bar)

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

# Anonymous and subsetted functions return NULL:
call_name(quote(foo$bar()))
call_name(quote(foo[[bar]]()))
call_name(quote(foo()()))
# }
Documentation reproduced from package rlang, version 0.2.2, License: GPL-3

Community examples

Looks like there are no examples yet.