title: Trying to find networking metrics with R
body: <p>I have created a directed network in R.  I have to find the average degree, which I think I have, the diameter and the maximum/minimum clustering.  The diameter is the longest of the shortest distances between two nodes.  If this makes sense to anyone, please point me in the right direction.  I have what I have coded below so far.</p>
  
  <pre><code>library(igraph)
  
  ghw &lt;- graph.formula(1-+4:5:9:12:14, 2-+11:16:17, 3-+4:5:7, 
                       4-+1:3:6:7:8, 5-+1:3:6:7, 6-+4:5:8, 
                       7-+3:4:5:8:13, 8-+4:6:7, 9-+10:12:14:15, 
                       10-+9:12:14, 11-+2:16:17, 12-+1:9:10:14, 
                       13-+7:15:18, 14-+1:9:10:12, 15-+13:16:18, 
                       16-+2:11:15:17:18, 17-+2:11:16:18, 18-+13:15:16:17)
  plot(ghw)
  get.adjacency(ghw)
  </code></pre>
  
  <p>Total number of directed edges</p>
  
  <pre><code>numdeg &lt;- ecount(ghw)
  </code></pre>
  
  <p>Average number of edges per node</p>
  
  <pre><code>avgdeg &lt;- numdeg / 18
  </code></pre>