In the docs of igraph package there is an example
igraph.options(plot.layout=layout.reingold.tilford)
plot(graph.tree(20, 2))
the output should represent data as a tree. But what I get is
You apparently need to specify the root:
library(igraph)
g <- graph.tree(20, 2)
plot(g, layout = layout.reingold.tilford(g, root=1))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With