1

I kept getting on this error: Error in as.igraph.vs(graph, vids) : Invalid vertex name(s); while trying to induced subgraph. I did it on different vertices attribute, and managed to get the intended induced subgraph. Yet, I'm unable to get the subgraph on this particular vertices attribute. Here is the code: b<-induced_subgraph(snet,V(snet)$Daerah=="Sabak Bernam")

The column Daerah contained many other value, all of the value come back as error.

ThomasIsCoding
  • 96,636
  • 9
  • 24
  • 81
JULIANA
  • 11
  • 1
  • 1
    Shouldn't it be `b<-induced_subgraph(snet, names(V(snet))=="Sabak Bernam")`? – ThomasIsCoding Nov 10 '22 at 14:59
  • 2
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Nov 10 '22 at 15:25
  • See also https://stackoverflow.com/help/minimal-reproducible-example – Szabolcs Nov 11 '22 at 07:37

0 Answers0