node-is | R Documentation |
Get information on whether a node is a leaf (meaning that it doesn't have any children) and whether it is named.
node_is_leaf(x)
node_is_named(x)
node_is_named_leaf(x)
x |
A node, either from |
A logical value.
src <- "x <- rnorm(100, mean = 2)
any(duplicated(y))
x <- z + 1
any(duplicated(x))"
root <- src |>
tree_new() |>
tree_root()
node_is_leaf(root)
root |>
node_find(ast_rule(pattern = "z")) |>
node_is_leaf()
root |>
node_find(ast_rule(pattern = "z")) |>
node_is_named()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.