title: igraph creating a weighted adjacency matrix
body: <p>I'm trying to use the <code>igraph</code> package to draw a (sparse) weighted graph. I currently have an adjacency matrix, but cannot get the <code>graph.adjacency</code> function to recognise the edge weights.</p>
  
  <p>Consider the following random symmetric matrix:</p>
  
  <pre><code>m &lt;- read.table(row.names=1, header=TRUE, text=
  "           A          B          C          D           E         F
  A 0.00000000  0.0000000  0.0000000  0.0000000  0.05119703 1.3431599
  B 0.00000000  0.0000000 -0.6088082  0.4016954  0.00000000 0.6132168
  C 0.00000000 -0.6088082  0.0000000  0.0000000 -0.63295415 0.0000000
  D 0.00000000  0.4016954  0.0000000  0.0000000 -0.29831267 0.0000000
  E 0.05119703  0.0000000 -0.6329541 -0.2983127  0.00000000 0.1562458
  F 1.34315990  0.6132168  0.0000000  0.0000000  0.15624584 0.0000000")
  m &lt;- as.matrix(m)
  </code></pre>
  
  <p>To plot, first I must get this adjacency matrix into the proper <code>igraph</code> format. This should be relatively simple with <code>graph.adjacency</code>. According to my reading of the documentation for <a href="http://igraph.sourceforge.net/doc/R/graph.adjacency.html" rel="noreferrer"><code>graph.adjacency</code></a>, I should do the following:</p>
  
  <pre><code>library(igraph)
  ig &lt;- graph.adjacency(m, mode="undirected", weighted=TRUE)
  </code></pre>
  
  <p>However, it doesn't recognise the edge weights:</p>
  
  <pre><code>str(ig)
  # IGRAPH UNW- 6 8 -- 
  # + attr: name (v/c), weight (e/n)
  # + edges (vertex names):
  # [1] A--E A--F B--C B--D B--F C--E D--E E--F
  plot(ig)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/SiOc2.png" alt="enter image description here"> </p>
  
  <p>How do I get igraph to recognise the edge weights?</p>