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)

Arguments

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.

See also

expr_label(), f_label()

Examples

quo <- quo(foo(!! quo(bar))) quo
#> <quosure: local> #> ~foo(~bar)
# quo_expr() unwraps all quosures and returns a raw expression: quo_expr(quo)
#> foo(bar)
# This is used by quo_text() and quo_label(): quo_text(quo)
#> [1] "foo(bar)"
# Compare to the unwrapped expression: expr_text(quo)
#> [1] "~foo(~bar)"
# quo_name() is helpful when you need really short labels: quo_name(quo(sym))
#> [1] "sym"
quo_name(quo(!! sym))
#> [1] "function (x) ..."