View source: R/nested-to-tree.R
create_node_from_nested_root | R Documentation |
This function is convenient to display all nesting levels of a nested data frame at once.
create_node_from_nested_root(pd_nested, structure_only)
pd_nested |
A nested data frame. |
structure_only |
Whether or not create a tree that represents the structure of the expression without any information on the tokens. Useful to check whether two structures are identical. |
An object of class "Node" and "R6".
if (rlang::is_installed("data.tree")) {
withr::with_options(
list(styler.cache_name = NULL), # temporarily deactivate cache
{
code <- "a <- function(x) { if(x > 1) { 1+1 } else {x} }"
nested_pd <- compute_parse_data_nested(code)
initialized <- styler:::pre_visit_one(
nested_pd, default_style_guide_attributes
)
styler:::create_node_from_nested_root(initialized,
structure_only = FALSE
)
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.