igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Indexing issues with vectors in R


From: giorgio delzeri
Subject: [igraph] Indexing issues with vectors in R
Date: Mon, 28 Aug 2017 15:38:09 +0200

Hi R community!
I have a problem with a vector indexing in R.
I have already had a similar problem that I solved in the past, but this time the stuff is slightly different.
Last time, the problem was the following:

"w <- unique(unlist(adjacent_vertices(g, which(V(g)$compartment=="SPREADER")))) 
  
  dummy_1 <- which(V(g)$compartment[w]=="IGNORANT")"
 
which I solved by adding the following line of code:

" dummy_1 <- w[dummy_1]".
Once I added the previous line of code, I solved the indexing problem I had with the "dummy_1" vertex.

This time it seems to be slightly different, because I start from:

"dummy_2 <- which(V(g)$compartment=="SPREADER")"

Do you have any suggestion on how I can, this time, deal with the indexing problem of the "dummy_2" vertex?
obviously, this time I cannot add the comand "dummy_2 <- w[dummy_2]" because I have not  a "w" vector to use.
Thanks! Giorgio

Mail priva di virus. www.avast.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]