title: using graph.adjacency() in R
body: <p>I have a sample code in R as follows:</p>
  
  <pre><code>library(igraph)
  rm(list=ls())
  dat=read.csv(file.choose(),header=TRUE,row.names=1,check.names=T) # read .csv file
  m=as.matrix(dat)
  net=graph.adjacency(adjmatrix=m,mode="undirected",weighted=TRUE,diag=FALSE)
  </code></pre>
  
  <p>where I used csv file as input which contain following data:</p>
  
  <pre><code>    23732   23778   23824   23871   58009   58098   58256
  23732   0   8   0   1   0   10  0
  23778   8   0   1   15  0   1   0
  23824   0   1   0   0   0   0   0
  23871   1   15  0   0   1   5   0
  58009   0   0   0   1   0   7   0
  58098   10  1   0   5   7   0   1
  58256   0   0   0   0   0   1   0
  </code></pre>
  
  <p>After this I used following command to check weight values:</p>
  
  <pre><code>E(net)$weight
  </code></pre>
  
  <p>Expected output is somewhat like this:</p>
  
  <pre><code>&gt; E(net)$weight
   [1]  8  1 10  1 15  1  1  5  7  1
  </code></pre>
  
  <p>But I'm getting weird values (and every time different):</p>
  
  <pre><code>&gt; E(net)$weight
   [1] 2.121996e-314 2.121996e-313 1.697597e-313  1.291034e-57 1.273197e-312 5.092790e-313 2.121996e-314 2.121996e-314 6.320627e-316 2.121996e-314 1.273197e-312 2.121996e-313
  [13] 8.026755e-316  9.734900e-72 1.273197e-312 8.027076e-316 6.320491e-316 8.190221e-316 5.092790e-313  1.968065e-62 6.358638e-316
  </code></pre>
  
  <p>I'm unable to find where and what I am doing wrong?
  Please help me to get the correct expected result and also please tell me why is this weird output and that too every time different when I run it.??</p>
  
  <p>Thanks,
  Nitin</p>