I have this graph:
df<-data.frame(x=c('a','b','c'),y=c('d','c','f'))
g<-graph.data.frame(df,directed=F)
is there a way to return two lists of vertexes according to which subgraph they belong?
I'd like to get to this output:
vertex id
1 a 1
2 d 1
3 b 2
4 c 2
5 f 2
Thank you