I'm trying to make a network plot in igraph that highlights certain important edges by coloring them differently than the others. For large graphs, they often get buried under the others. For example:
library(igraph)
test <- barabasi.game(200,m=2)
E(test)$color <- "gray"
E(test)[1]$color <- "red"
sort(order(E(test)$color)[E(test)],decreasing=TRUE)
plot(test,
vertex.label=NA,
vertex.shape="none",
vertex.size=0,
edge.arrow.mode=0,
edge.width=2)
gives me a plot where the single red edge is at the bottom. If I choose to color a higher-numbered edge (rather than #1) it has a better chance of not being buried.
So it seems to me that one option is to somehow re-order the edges. I tried
E(test) <- E(test)[order(E(test)$color)]
but that gets me an "invalid indexing" error. Any ideas about what else I should try?