# random tree of OTUs
set.seed(0)
tr <- rtree(100)
# taxnomy of the OTUs
tax <- data.frame(name = sample(tr$tip.label),
phylum = sapply(sample(1:3,Ntip(tr),replace = TRUE), function(x) paste("phylum",x,sep="_")),
class = sapply(sample(1:10,Ntip(tr),replace = TRUE), function(x) paste("class",x,sep="_")),
family = sapply(sample(1:12,Ntip(tr),replace = TRUE), function(x) paste("family",x,sep="_")),
genus = sapply(sample(1:20,Ntip(tr),replace = TRUE), function(x) paste("genus",x,sep="_"))
)
# species abundance of the OTUs in samples
data <- data.frame(matrix(runif(600),ncol=6),row.names = sample(tr$tip.label))
p <- ggtree(tr) + geom_tiplab(align = TRUE)
gheatmap(p,data)