tree_new | R Documentation |
This function takes R code as string and creates the corresponding abstract syntax tree (AST) from which we can query nodes.
tree_new(txt, file, ignore_tags = "ast-grep-ignore")
txt |
A character string of length 1 containing the code to parse.
If provided, |
file |
Path to file containing the code to parse. If provided, |
ignore_tags |
Character vector indicating the tags to ignore. Default is
|
An abstract syntax tree containing nodes
src <- "x <- rnorm(100, mean = 2)
any(duplicated(y))
plot(x)
any(duplicated(x))"
tree_new(src)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.