On Fri, Oct 19, 2012 at 2:50 PM, Dhaval Adjodah <nuclear...@gmail.com> wrote:
[...]
> Your way works best! Another way I found from stackoverflow (see the post
> at
> http://stackoverflow.com/questions/12964332/igraph-edge-between-two-vertices/12980550#12980550)
> was
> to convert the graph into an adjacency matrix and then use simple matrix
> indices .

Just make this clear. The example (repeated below) on the
stackoverflow page does _not_ convert the graph into an adjacency
matrix. The indexing only makes the graph look as if it was an
adjacency matrix. But there is no conversion at all.

Gabor

ps. I would appreciate if you didn't cross-post your questions
everywhere (R-help, igraph-help and stackoverflow, maybe other places
as well). Please only post it on the platform you prefer first and
then, if you don't get a good answer, try elsewhere. Thanks!

library(igraph)
g <- graph.ring(10)
g[1,2]
# [1] 1
E(g)$weight <- runif(ecount(g))
g[1,2]
# [1] 0.8115639

[...]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to