create_subtree | R Documentation |
Create a subtree dataframe.
create_subtree(parents, specs, level)
parents |
Integer() with parent's ids. |
specs |
List of tree specs. |
level |
The tree level. |
Create a subtree dataframe used to build a tree with integer as id.
Dataframe with subtree.
root <- 1L
specs <- list(
l1 = list(digits = 100, nnodes = 9),
l2 = list(digits = 100, nnodes = 19),
l3 = list(digits = 100, nnodes = 29))
df <- data.frame(
parent = root,
child = root,
level = 0L)
out <- create_subtree(parents = df$child, specs[[1]], level = 1)
stopifnot((nrow(out) == specs[[1]]$nnodes))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.