1

这是一个示例代码:

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()

我怎样才能“屏蔽”自链接?我想删除它们以保持空间为空(右图)。

在此处输入图像描述

4

1 回答 1

2

这似乎工作......

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

在此处输入图像描述

于 2017-05-30T17:23:18.490 回答