quo_expr {rlang} | R Documentation |
quo_expr()
flattens all quosures within an expression. I.e., it
turns ~foo(~bar(), ~baz)
to foo(bar(), baz)
. quo_text()
and
quo_label()
are equivalent to f_text()
, expr_label()
, etc,
but they first splice their argument using quo_expr()
.
quo_name()
transforms a quoted symbol to a string. It adds a bit
more intent and type checking than simply calling quo_text()
on
the quoted symbol (which will work but won't return an error if not
a symbol).
quo_expr(quo, warn = FALSE) quo_label(quo) quo_text(quo, width = 60L, nlines = Inf) quo_name(quo)
quo |
A quosure or expression. |
warn |
Whether to warn if the quosure contains other quosures (those will be collapsed). |
width |
Width of each line. |
nlines |
Maximum number of lines to extract. |
quo <- quo(foo(!! quo(bar))) quo # quo_expr() unwraps all quosures and returns a raw expression: quo_expr(quo) # This is used by quo_text() and quo_label(): quo_text(quo) # Compare to the unwrapped expression: expr_text(quo) # quo_name() is helpful when you need really short labels: quo_name(quo(sym)) quo_name(quo(!! sym))