igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Re: network neighborhood


From: anupam sinha
Subject: [igraph] Re: network neighborhood
Date: Fri, 1 Oct 2010 13:23:15 +0530






Dear all,
                 I have a list of network files for which I want to find the network neighborhoods(order=1) of each of the nodes of these networks. And then store all the subgraphs hence obtained in separate files.Another thing that I would like to do is to name them in such a way so as to figure out from which network file have they originated. But what I am getting as output is an empty file.Here's my code :


library("igraph")
path <- "path/to/network/files/"
files <- dir(path)
for(i in 1:length(files)){
                          file <- paste(path,"/",files[i],sep="")
                          g<-read.graph(file,format="ncol", directed=FALSE, weights=FALSE)
                          g<-simplify(g)
                          subgraphs<-graph.neighborhood(g,1,nodes=V(g))
for(j in subgraphs){
gr_name <- paste(file,j,sep="")
write.graph(gr,"/path/tonetwork/files/gr_name.txt",format="ncol")
}}

Attached herewith are a couple of network files. Can anyone tell where am I going wrong? Thanks in advance.

Here's my sessionInfo():

R version 2.11.0 (2010-04-22)
x86_64-redhat-linux-gnu

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C             
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8   
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8  
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                
 [9] LC_ADDRESS=C               LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C      

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
[1] igraph_0.5.3

loaded via a namespace (and not attached):
[1] tools_2.11.0


Regards,

Anupam Sinha







--
Graduate Student,
Center For DNA Fingerprinting And Diagnostics,
4-1-714 to 725/2, Tuljaguda complex
Mozamzahi Road, Nampally,
Hyderabad-500001

reply via email to

[Prev in Thread] Current Thread [Next in Thread]