Skip to content
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

geom_cladelab doesn't facet #603

Open
dansmith01 opened this issue Feb 12, 2024 · 0 comments
Open

geom_cladelab doesn't facet #603

dansmith01 opened this issue Feb 12, 2024 · 0 comments

Comments

@dansmith01
Copy link

# Create two trees of different sizes; label nodes that aren't common to both.
set.seed(0)
lg  <- full_join(by = "node", rtree(5), data.frame(node = c(7, 9), clade = c("A", "B")))
sm  <- full_join(by = "node", rtree(3), data.frame(node = 5, clade = "C"))
trs <- structure(list(lg = lg, sm = sm), class = "treedataList")

# Internal clade labels with geom_label() works fine.
ggtree(trs) + 
  geom_label(data = td_filter(!is.na(clade)), mapping = aes(label = clade)) + 
  facet_wrap(~.id)

Rplot03

# External clade label with geom_cladelab() doesn't work:
ggtree(trs) + 
  geom_cladelab(data = td_filter(!is.na(clade)), mapping = aes(node = node, label = clade)) + 
  facet_wrap(~.id)

> Warning message:
> In x$node != rn :
>   longer object length is not a multiple of shorter object length

Note that the warning message only shows up after force-quitting the process, which seems to be in a CPU-heavy infinite loop.

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