get_index: Get Index of RStatic Object

Description Usage Arguments Value Examples

View source: R/find_nodes.R

Description

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

Usage

1
get_index(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))

get_index(node)

nick-ulle/ast documentation built on July 17, 2018, 4:16 a.m.