where_is: Where is RStatic Object in Tree?

Description Usage Arguments Value Examples

View source: R/find_nodes.R

Description

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

Usage

1
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

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

where_is(node)

nick-ulle/ast documentation built on Oct. 18, 2019, 4:37 a.m.