I am trying to subset a igraph graph by an edge characteristics (like its label). In the reproducible example I have shamelessly stolen from another post with a little modification, I would like to be able to separate the Best Friend ties (BF) from the Family ties (FAM):
edges <- matrix(c(103, 86, 24, 103, 103, 2, 92, 103, 87, 103, 103, 101, 103, 44), ncol=2, byrow=T)
g <- graph(as.vector(t(edges)))
E(g)[c(2:4,7)]$label<-"FAM"
E(g)[c(1,5,6)]$label<-"BF"
The best I can do so far is display the edges which have one type of tie:
E(g)[E(g)$label=="BF"]
V(g)[E(g)$label=="BF"]