is_quosure {rlang}R Documentation

Is an object a quosure or quosure-like?

Description

These predicates test for quosure objects.

Usage

is_quosure(x)

is_quosureish(x, scoped = NULL)

Arguments

x

An object to test.

scoped

A boolean indicating whether the quosure or formula is scoped, that is, has a valid environment attribute. If NULL, the scope is not inspected.

See Also

is_formula() and is_formulaish()

Examples

# Quosures are created with quo():
quo(foo)
is_quosure(quo(foo))

# Formulas look similar to quosures but are not quosures:
is_quosure(~foo)

# But they are quosureish:
is_quosureish(~foo)

# Note that two-sided formulas are never quosureish:
is_quosureish(a ~ b)

[Package rlang version 0.1.6 Index]