where_is: Where is RStatic Object in Tree?

View source: R/find_nodes.R

where_isR Documentation

Where is RStatic Object in Tree?

Description

This function finds the index of the given RStatic object relative to its ancestor nodes.

Usage

where_is(node, index = integer(0))

Arguments

node

(ASTNode) The RStatic object to traverse.

index

(integer) Initial index. The value of this parameter is appended to the end of the computed index.

Value

An integer vector which can be used as an index in the child() function.

Examples

ast = quote_ast(x <- y + z)
node = child(ast, c(2, 2, 1))

where_is(node)

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