Copy your chart first, delete the edges that you donβt need, and write down the rest:
> sgdf.copy <- delete.edges(sgdf, which(E(sgdf)$weight != 3)-1)
> plot(sgdf.copy)
-1required delete.edgesbecause igraph uses zero-based zero indexes, while R uses 1-based indexes.
Update : as an anonymous editor (whose editing was sadly rejected), indicated that igraph uses 1-base edge indices from igraph 0.6 onwards. Therefore, subtract 1 only if you use igraph 0.5.x or earlier.
source
share