View source: R/tree_routines.R
get_recursive_index | R Documentation |
Obtains an index that can be used to extract a sub-call from a language object.
get_recursive_index(th, node_id)
th |
A TreeHarp object. |
node_id |
An integer corresponding to a call within the parse tree (not a literal, symbol or a formal argument). |
A vector of indices, that can be used (together with "[[") to obtain a sub-call
ex3 <- quote(x <- f(y = g(3, 4), z=1L))
t1 <- TreeHarp(ex3, TRUE)
rec_index <- get_recursive_index(t1, 6)
ex3[[rec_index + 1]]
ex3[[get_recursive_index(t1, 3)+1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.