this is probably a stupid question, but it isn't obvious to me how to plot a dendrogram in which branch lengths are determined by the data (i.e. a 'chronogram' in phylogenetics, where branch lengths represent evolutionary time). Consider this example:
In ape, an example phylogeny has branch length data, which is reflected in the plot:
library(ape)
data("bird.orders")
plot(bird.orders)
Using the awesome tidygraph, we coerce this:
library(tidygraph)
library(ggraph)
bird <- as_tbl_graph(bird.orders)
looks like edge lengths are lost in this transformation? (guess that's a tidygraph issue>). Even if I just manually add a column of branch lengths (below just picking lengths at random), I'm not sure how to map the length column of the edge table to branch lengths to get a plot like the ape plot above... is this possible with the current layout? If not, is this something you would consider supporting?
bird %>% activate(edges) %>%
mutate(length = abs(rnorm(44))) %>%
ggraph(layout="dendrogram") + geom_edge_elbow()
this is probably a stupid question, but it isn't obvious to me how to plot a dendrogram in which branch lengths are determined by the data (i.e. a 'chronogram' in phylogenetics, where branch lengths represent evolutionary time). Consider this example:
In
ape, an example phylogeny has branch length data, which is reflected in the plot:Using the awesome
tidygraph, we coerce this:looks like edge lengths are lost in this transformation? (guess that's a
tidygraphissue>). Even if I just manually add a column of branch lengths (below just picking lengths at random), I'm not sure how to map thelengthcolumn of the edge table to branch lengths to get a plot like the ape plot above... is this possible with the current layout? If not, is this something you would consider supporting?