I want to print cliques for a graph using igraph of R package. The format of data I want to print as A B C (showing this data in Res1, Res2, Res3 format...)
Data: Res1 Res2 Weight A B 10 A C 1 C B 10 S B 1 L A 2
library(igraph)
file <- read.table("GraphDemo.net", header=TRUE)
graph <- graph.data.frame(file, directed=F)
Cliq <- cliques(graph, min = 3, max = NULL)
If we want to print the Cliq on the terminal
Cliq
[[1]] + 3/5 vertices, named: [1] A C B
Which is all very good. But if we want to print to file:
write.table(t(Cliq), file="demo.dat",sep = "\t",quote=F,row.names = FALSE)
But the result from file is: V1 c(1, 2, 5)
I want to print data as just the node names A B C. What is the way out guys..!!