child | R Documentation |
This function extracts or replaces a descendant of the given node.
child(node, index)
child(node, index) <- value
node |
(ASTNode) The node from which to extract or replace the descendant. |
index |
(integer) The index of the descendant to extract or replace. |
value |
(ASTNode) The value to replace the descendant with. |
If index
is a vector, the child
function is called recursively
so that descendants several levels below node
are accessible.
A single child node.
children
to extract or replace all children at once.
code = quote_ast(mean(1, 2, 3 + x))
x = child(code, c(2, 3, 2, 2))
child(code, c(2, 3, 2, 2)) = Integer$new(4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.