arg_expr

0th

Percentile

Find the expression associated with an argument

arg_expr() returns the full expression ans is equivalent to the base function substitute(); arg_text() turns the expression into a single string; arg_label() formats it nicely for use in messages.

Usage
arg_expr(x)
arg_label(x)
arg_text(x, width = 60L, nlines = Inf)
Arguments
x
Argument to capture.
width
Width of each line.
nlines
Maximum number of lines to extract.
Aliases
  • arg_expr
  • arg_label
  • arg_text
Examples
arg_label(10)

# Names a quoted with ``
arg_label(x)

# Strings are encoded
arg_label("a\nb")

# Expressions are captured
arg_label(a + b + c)

# Long expressions are collapsed
arg_label(foo({
  1 + 2
  print(x)
}))
Documentation reproduced from package rlang, version 0.0.0.9000, License: GPL-3

Community examples

Looks like there are no examples yet.