quo_label {rlang}R Documentation

Format quosures for printing or labelling

Description

[Superseded]

Note: You should now use as_label() or as_name() instead of quo_name(). See life cycle section below.

These functions take an arbitrary R object, typically an expression, and represent it as a string.

These deparsers are only suitable for creating default names or printing output at the console. The behaviour of your functions should not depend on deparsed objects. If you are looking for a way of transforming symbols to strings, use as_string() instead of quo_name(). Unlike deparsing, the transformation between symbols and strings is non-lossy and well defined.

Usage

quo_label(quo)

quo_text(quo, width = 60L, nlines = Inf)

quo_name(quo)

Arguments

quo

A quosure or expression.

width

Width of each line.

nlines

Maximum number of lines to extract.

Life cycle

These functions are superseded.

See Also

expr_label(), f_label()

Examples

Run examples

# Quosures can contain nested quosures:
quo <- quo(foo(!! quo(bar)))
quo

# quo_squash() unwraps all quosures and returns a raw expression:
quo_squash(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))

[Package rlang version 1.1.4 Index]