我正在尝试对包含相同分类群的两棵树进行系统发育比较。我想根据隔离站点为连接着色。我原以为我已经成功地完成了这项工作,但我的工作流程出现了错误,即彩色线条与隔离部位不准确对应。我想知道您是否有任何见解,请在下面找到我的可重复示例。
site <- structure(list(name = structure(c(1L, 3L, 4L, 5L, 6L, 7L, 8L,9L, 10L, 2L), .Label = c("t1", "t10", "t2", "t3", "t4", "t5","t6", "t7", "t8", "t9"), class = "factor"), site = c(1L, 1L,1L, 2L, 2L, 3L, 1L, 3L, 2L, 2L)), .Names = c("name", "site"), row.names = c(NA,10L), class = "data.frame")
library(ape)
t1 <- rtree(10)
t2 <- rtree(10)
order <- cbind(t1$tip.label)
list <- merge(order, site, by.x="V1", by.y="name")
x <- list$site
A <- cbind(t1$tip.label, t1$tip.label)
cophyloplot(t1, t2, assoc = A, show.tip.label = T, space=50, col = x)
就目前而言,这是我当前的输出: