node_to_df | R Documentation |
Turn a Node object into predictor and outcome.
node_to_df(x, drop_last_level = TRUE)
x |
Node object |
drop_last_level |
TRUE unused |
a named list of x and y, being respectively the predictor data-frame and the outcomes data-frame,
as expected inputs for hardhat::mold()
function.
library(dplyr)
library(data.tree)
data(starwars)
starwars_tree <- starwars %>%
mutate(pathString = paste("tree", species, homeworld, `name`, sep = "/")) %>%
as.Node()
node_to_df(starwars_tree)$x %>% head()
node_to_df(starwars_tree)$y %>% head()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.