These helpers are consistent wrappers around their base R equivalents. A language object is either an atomic vector (typically a scalar), a name (aka a symbol), a call, or a pairlist (used for function arguments).

is_lang(x)

is_name(x)

is_call(x)

is_pairlist(x)

is_atomic(x)

Arguments

x

An object to test.

See also

as_name() and as_call() for coercion functions.

Examples

q1 <- quote(1)
is_lang(q1)
#> [1] TRUE
is_atomic(q1)
#> [1] TRUE

q2 <- quote(x)
is_lang(q2)
#> [1] TRUE
is_name(q2)
#> [1] TRUE

q3 <- quote(x + 1)
is_lang(q3)
#> [1] TRUE
is_call(q3)
#> [1] TRUE