lang_name

0th

Percentile

Extract function name of a call

Extract function name of a call

Usage
lang_name(lang)
Arguments
lang

Can be a call (language object), a formula quoting a call in the right-hand side, or a frame object from which to extract the call expression.

Value

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

See Also

lang_fn()

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

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

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

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

Community examples

Looks like there are no examples yet.