Skip to content
Prev 227681 / 398500 Next

send out put to file in R

Dear Gabor Csardi,

Thanks. The problem is now resolved.
Apart from typo errors like "wri" before "write..." and "lecompose" instead
of "decompose", My command "write.graph.. <- decompose...." was itself a
blunder.
I did not figure out how to access the graph object in compo. It turns out
that "compo[[i]]" is the graph object. That must be the reason for Error
message "Not a graph object"
I want to extract the largest connected component (alias sub-graph) of the
network. My input network is a large network of >1000 vertices and >15000
arcs. From this, I want to take out only the largest cluster.
Yes. But I want only the largest sub-graph. It is first in the list
sub-graphs generated. Am I right ? I tried with 10 files, and all the time
the largest sub-graph is shown first in the list. (i.e i=1, in compo[[i]])
It worked. I Just had to give entire file path instead of just "new" !

for (i in seq_along(compo)) {
write.graph(compo[[i]], file=paste(sep="", "F://new-", i, ".net"), "pajek")
}

or For the first component 
write.graph(compo[[1]], "F://new.net", "pajek")

Chakri




Second,