0

How can I choose one vertex at a time, from a vertex sequence, from the highest degree to the lowest? That's what I tried:

peso <- sort(V(grafo)[id]$wei, decreasing=TRUE)
pesosm <- which(V(grafo)[id]$wei==peso)

V(grafo)$wei is where I stored each vertex degree. This didn't work. Thanks in advance.

BlueSea
  • 27
  • 4
  • 1
    If you save the vertices you want with something like `vseq <- V(grapfo)[id]`, then you'd only need `vseq[sort(vseq$wei, decreasing=TRUE, index.return=TRUE)$ix]` – Alexis Jul 13 '18 at 22:54
  • 1
    When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jul 13 '18 at 23:31

0 Answers0