title: igraph "Not a graph object"
body: <p>I intend to get some statistics on a network using the igraph package.</p>
  
  <pre><code>model1 &lt;- ug(~a:b, ~a:c:d,~b:c)
  &gt; model1
  A graphNEL graph with undirected edges
  Number of Nodes = 4 
  Number of Edges = 5 
  </code></pre>
  
  <p>Problem: using the function:</p>
  
  <pre><code>cluster.distribution(model1)
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>Error in cluster.distribution(model1) : Not a graph object.
  </code></pre>
  
  <p>Now if I apply the function:</p>
  
  <pre><code>degree(model1)
  </code></pre>
  
  <p>i get the same error:</p>
  
  <pre><code>Error in degree(model1) : Not a graph object
  </code></pre>
  
  <p>however if I detach the igraph package i get:</p>
  
  <pre><code>&gt; detach("package:igraph", unload=TRUE)
  Warning message:
  'igraph' namespace cannot be unloaded:
    namespace 'igraph' is imported by 'gRbase', 'gRain' so cannot be unloaded 
  &gt; degree(model1)
  a b c d 
  3 2 3 2
  </code></pre>
  
  <p>I assume the problem is related the the packages, but my R skill don't go so far as that I would be able to figure this problem out by myself.</p>
  
  <pre><code>&gt; search()
   [1] ".GlobalEnv"       "package:gRain"    "package:grid"    
   [4] "package:gRbase"   "package:graph"    "tools:rstudio"   
   [7] "package:stats"    "package:utils"    "package:datasets"
   [10] "package:methods"  "Autoloads"        "package:base" 
  </code></pre>
  
  <p>I am really interested in using the function from the igraph package so please help me figure out why I get this error even though it is obviously a graph object.</p>
  
  <p>Thx!   </p>