Skip to content

geom_cladelab doesn't facet #603

Open
@dansmith01

Description

@dansmith01
# 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions