R(circlize):如何删除自我链接?

时间:2017-05-30 16:44:49

标签: r graph circlize circos

以下是一个示例代码:

df <- rbind(matrix(rep(sample(5),2),5,2),matrix(sample(10),5,2))

model_color <- unique(as.vector(df))
names(model_color) <- model_color

brand <- unique(as.vector(df))
names(brand) <- brand

chordDiagram(data.frame(df), order = names(brand), grid.col = model_color, directional = 0)
circos.clear()

我怎样才能&#34;掩盖&#34;自我链接?我想删除它们保持空白(右图)。

enter image description here

1 个答案:

答案 0 :(得分:1)

这似乎有用......

transparency <- ifelse(df[,1]==df[,2],1,0.5)
chordDiagram(data.frame(df), order = names(brand), 
         transparency=transparency,grid.col = model_color, directional = 0)

enter image description here