Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
emilyvansyoc opened this issue Apr 9, 2025 · 0 comments

Comments

@emilyvansyoc
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant