tree <- read.tree("tree.tre")
dd <- read.csv("data.txt",
sep = "\t",
col.names = c("tipLabel", "dat"),
header = FALSE,
stringsAsFactors = TRUE)
dd.sub <- subset(dd, tipLabel %in% tree$tip.label)
dd.sub$dat <- ifelse(dd.sub$dat=="YES","present","absent")
row.names(dd.sub) <- NULL
circ <- ggtree(tree, layout="circular", branch.length = "none")
p <- gheatmap(circ, dd.sub["dat"], offset=0.1, width=0.02,
low="salmon",high="black", color="purple") +
scale_fill_manual(values=c("salmon","black")) +
coord_polar(theta='y')
png("error.png")
plot(p)
dev.off()
# I'm pretty sure I've set up my dataframe ok
> head(dd.sub["dat"])
dat
1 present
2 absent
3 present
4 absent
5 absent
6 absent
# Data consists of "present" or "absent" only
> summary(factor(dd.sub$dat))
absent present
88 185
# There's a 1:1 between my tips & binary data
> summary(dd.sub$tipLabel %in% tree$tip.label)
Mode TRUE
logical 273
--
G Yu, DK Smith, H Zhu, Y Guan, TTY Lam*. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data, Methods in Ecology and Evolution, 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
Homepage: https://guangchuangyu.github.io/software/ggtree
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree+unsubscribe@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/4da1c3a0-6b8a-46ec-a7e2-89fcdf48300c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
maybe you should try color = NULL to disable drawing cell borders. It seems that the color we can see on the plot are all ‘purple` that you specifying for the cell border.