专栏名称: YuLabSMU
专注于生物信息学、R语言和可视化,只有原创、拒绝爆款!
目录
相关文章推荐
爱生活的燃烧  ·  至高5倍,还立减220?当然全都要! ·  2 天前  
爱生活的燃烧  ·  至高5倍,还立减220?当然全都要! ·  2 天前  
51好读  ›  专栏  ›  YuLabSMU

ggjoy facet with ggtree

YuLabSMU  · 公众号  ·  · 2017-08-01 11:12

正文

请到「今天看啥」查看全文


I think that Guangchuang Yu’s examples at the above link provide suitable data:

require(ggtree)
require(ggstance)# generate tree

tr 30)# create simple ggtree object with tip labels
p 0.02)
# Generate categorical data for each "species"
d1 "GZ", "HK", "CZ"), 30, replace=TRUE))
#Plot the categorical data as colored points on the tree tips

p1 # Generate distribution of points for each species

d4 = data.frame(id=rep(tr$tip.label, each=20),            val=as.vector(sapply(1:30, function(i)                            rnorm(20, mean=i)))            )               # Create panel with boxplot of the d4 data
p4 "Boxplot", data=d4, geom_boxploth,        mapping = aes(x=val, group=label, color=location))           plot(p4)

This produces the plot below:







请到「今天看啥」查看全文