names_used: Symbols Used by an Expression

View source: R/get_symbols.R

names_usedR Documentation

Symbols Used by an Expression

Description

This function returns a character vector of the symbols used by an expression.

Usage

names_used(x, ...)

Arguments

x

A language object, ASTNode object, or SymbolSets object.

...

Further arguments to methods.

Details

If you need both the symbols defined and the symbols used by an expression, it is more efficient to first call get_symbols() on the expression and then call names_defined() and/or names_used() on the result.

Value

A character vector.

See Also

names_defined(), get_symbols(), CodeDepends::getInputs()

Examples

expr = quote(x = x + y)
names_used(expr)

# If defined symbols and used symbols are both needed:
symbols = get_symbols(expr)
names_defined(symbols)
names_used(symbols)

nick-ulle/ast documentation built on May 14, 2024, 7:40 p.m.