Open chendaniely opened 6 years ago
In the current dev version of networkD3
, treeNetwork
supersedes radialNetwork
and the other tree network plotting functions. treeNetwork
should handle an 'edgelist' as in your example, though your example does expose a problem when a root node is not specified in the data. Modifying your example somewhat, the following does work...
pokemon <- read.csv(header = T, text = "
name,meta.contruct
root,
Pikachu,Pichu
Pichu,root
Raichu,Pikachu
Eevee,root
Vaporeon,Eevee
Jolteon,Eevee
Flareon,Eevee
")
treeNetwork(pokemon, direction = "radial",
cols = c(nodeId = "name", parentId = "meta.contruct"))
Here's a snippet of code when you have an edgelist and want to use it to create one of the tree diagrams (e.g.,
radialNetwork
)would this be good to put in the docs for
radialNetwork
?