Thanks, Gabor. That's both more simple and more elegant than my code. I shall 
begin using it at once.

Very cool.

-Alan



> Hi,
> 
> you can actually assign the bucket attributes all at once, and this is
> relatively fast, the graph is only copied once.
> 
> ## Some example data
> g <- degree.sequence.game(sample(2:10), method="simple")
> buckets <- letters[seq_len(vcount(g))]
> 
> ## Assign buckets
> V(g)$bucket[order(degree(g), decreasing=TRUE)] <- buckets
> 
> ## Check result
> V(g)$bucket
> 
> ## This gives the same solution as your function:
> V(foo(g, buckets))$bucket
> 
> Gabor

_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to