R(circlize):如何删除自链接?
R (circlize): How to remove self links?
这是一个示例代码:
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()
如何 "mask" 自链接?我想删除它们,使 space 为空(右图)。
这似乎有效...
transparency <- ifelse(df[,1]==df[,2],1,0.5)
chordDiagram(data.frame(df), order = names(brand),
transparency=transparency,grid.col = model_color, directional = 0)
这是一个示例代码:
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()
如何 "mask" 自链接?我想删除它们,使 space 为空(右图)。
这似乎有效...
transparency <- ifelse(df[,1]==df[,2],1,0.5)
chordDiagram(data.frame(df), order = names(brand),
transparency=transparency,grid.col = model_color, directional = 0)