liamrevell / phytools

GNU General Public License v3.0
198 stars 56 forks source link

fixed bug in option mean.edge about length of edge.length #129

Open fpavone opened 1 year ago

fpavone commented 1 year ago

Bug: edge.length was as long as the number of nodes, but it should be the number of nodes - 1.

The following code shows the bug

trees <- pbtree(n = 5, scale = 10, nsim = 10)
cons <- consensus.edges(trees, 
                         method = "mean.edge",
                         rooted = TRUE)
nrow(cons$edge) == length(cons$edge.length) # before FALSE, now TRUE