Identifying cliques in R
问题 I have a dataframe like this: 1 2 2 3 4 5 .... Now, I plot this graph in R using the library igraph using the following code: wt=read.table("NP7.txt") wt1=matrix(nrow=nrow(wt), ncol=2) wt1=data.frame(wt1) wt1[,1:2]=wt[,1:2] write.table(wt1,"test.txt") library(igraph) wt=read.table("test.txt") wg7 <- graph.edgelist(cbind(as.character(wt$X1), as.character(wt$X2)), directed=F) sum(clusters(wg7)$csize>2) plot(wg7) a <- largest.clique(wg7) Now, on running this code I get the plot of the graph and