My problem is as it follows. I’m dealing with big data graphs using R/igraph.
I need to convert the output of clusters()$membership (i.e a vector), to a list which groups the values.
Example: I have the vector (3,3,3,1,1,4,4) I need a list having the following estructure
l<-list()
l[["3"]]<-c(1,2,3)
l[["4"]]<-c(6,7)
l[["1"]]<-c(4,5)
this is, the structure the output of maximal.cliques() function has
I’ve tried using lapply on a list of levels, and then using which to find the indexes for a certain value. However this performs really poorly. I’m dealing with data vectors of 180K elements where there may be 60K diffenrent levels.
look at split():