title: Neighbors error "Erreur dans as.igraph.vs(graph, v) : Invalid vertex name(s) "
body: <p>Using a igraph graph, I have a data frame of nodes of graph g1,</p>
  
  <pre><code>DC1&lt;-data.frame(
  node=V(g1)$name,
  Frequency=DC1$'DC')
  DC2&lt;-DC1[order(-DC1$'Frequency'),]
  </code></pre>
  
  <p>I use a loop, and at each step I take the first node of the data frame. For this node I calculate its neighbors, and after I delete it and its neighbors from the graph and from the data frame.</p>
  
  <p>The problem is at some step I have this message `</p>
  
  <p>Erreur dans as.igraph.vs(graph, v) : Invalid vertex name(s)<code>.
  </code></p>
  
  <p>When I try to know why, I find that at this step the algorithm can't read the first row of the data frame, so I can't get the neighbors to continue the process.</p>
  
  <pre><code>while(length(get.edgelist(g1))&gt;0){
  
   v&lt;-DC2$node[(order(-DC2$'Frequency'))]
   L&lt;-V(g1)[V(g1)$name==v[1]]
  
   Nei &lt;- neighbors(g1,L,1)
  
  }
  </code></pre>
  
  <p>the problem is here :                                                                              </p>
  
  <pre><code> &gt; v&lt;-DC2$node[(order(-DC2$'frequency')) ]
     &gt; L&lt;-V(g1)[V(g1)$name==v[1]]
     &gt; L
    Vertex sequence:
    [1] "125"
    &gt; Nei &lt;- neighbors(g1,L,1)
    &gt; Nei
    numeric(0)  
  </code></pre>
  
  <p>when i replace the <code>L</code> by its value, its works:  </p>
  
  <pre><code>  &gt; Nei &lt;- neighbors(g1,125,1)
     &gt; Nei
     [1]   28   30   76 1883
  </code></pre>