ggtree icon indicating copy to clipboard operation
ggtree copied to clipboard

geom_rootedge does not allow for no branch lengths if input tree is treedata

Open emilyvansyoc opened this issue 7 months ago • 0 comments
trafficstars

Hello,

I'm not sure if this is an issue for the treeio package or ggtree, but the geom_rootedge breaks when branch.lengths are 'none' and the input tree is a treedata object (this works fine for normal phylo trees). The error is "object 'branch.length' not found".

Here's a reproducible example:

# this works
ggtree(rtree(n = 5, rooted = TRUE), branch.length = "none") +
  geom_rootedge(rootedge = 1)

# this doesn't
rtd <- rtree(n=5, rooted = TRUE) %>% as_tibble() %>% as.treedata()
ggtree(rtd, branch.length = "none") +
  geom_rootedge(rootedge= 1)

emilyvansyoc avatar Apr 09 '25 18:04 emilyvansyoc