rlang (version 0.0.0.9000)

arg_expr: Find the expression associated with an argument

Description

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.

Examples

Run this code
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)
}))

Run the code above in your browser using DataCamp Workspace