title: R- iGraph Error: weight vector too short, Invalid value when applying community detection alogrithm
body: <p>I'm using igraph in R. I want use community detection algorithm with weights on the edges. However, I keep getting an error saying the weight vector too short. </p>
  
  <h2>Here's my code.</h2>
  
  <pre><code>actors &lt;- data.frame(name=c("Alice", "Bob", "Cecil", "David",
                              "Esmeralda"),
                       age=c(48,33,45,34,21),
                       gender=c("F","M","F","M","F"))
  
  relations &lt;- data.frame(from=c("Bob", "Cecil", "Cecil", "David",
                                 "David", "Esmeralda"),
                          to=c("Alice", "Bob", "Alice", "Alice", "Bob", "Alice"),
                          same.dept=c(FALSE,FALSE,TRUE,FALSE,FALSE,TRUE),
                          weight=c(4,5,5,2,1,1))
  
  g &lt;- graph.data.frame(relations, directed=FALSE, vertices=actors)
  
  print(g, e=TRUE, v=TRUE)
  
  community &lt;- multilevel.community(g, weights = TRUE) 
  </code></pre>
  
  <p>Here's the error I'm getting:</p>
  
  <pre><code>    Error in multilevel.community(g, weights = TRUE) : 
        At community.c:2424 : multi-level community detection:
        weight vector too short, Invalid value
  </code></pre>
  
  <p>Can anyone help me intepret this error, and see what's wrong with it? Thank you!</p>