ggtree
ggtree copied to clipboard
geom_rootedge does not allow for no branch lengths if input tree is treedata
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)