Skip to content

treedataList bug #699

@hanguojun007

Description

@hanguojun007

Data Integration, Manipulation and Visualization of Phylogenetic Trees 书中的第4.4.1处代码有bug

set.seed(2020)
x <- rtree(30)
d <- data.frame(label=x$tip.label, var1=abs(rnorm(30)), var2=abs(rnorm(30)))
tree <- full_join(x, d, by='label')
trs <- list(TREE1 = tree, TREE2 = tree)
class(trs) <- 'treedataList'
ggtree(trs) + facet_wrap(~.id) + 
  geom_tippoint(aes(subset=.id == 'TREE1', colour=var1)) + 
  scale_colour_gradient(low='blue', high='red') +  
  ggnewscale::new_scale_colour()  + 
  geom_tippoint(aes(colour=var2), data=td_filter(.id == "TREE2")) + 
  scale_colour_viridis_c()

修改geom_tippoint(aes(subset=.id == 'TREE1', colour=var1))geom_point2(aes(subset = .id == "TREE1" & isTip, colour = var1))

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