igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Import edgelist with isolates


From: Tim Elrick
Subject: Re: [igraph] Import edgelist with isolates
Date: Fri, 17 May 2013 15:08:04 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

Hi Tamas,

Great! Thanks!

Thanks also for the hint on the symbolic names. I was already aware of that and converted my numbers into characters.

Cheers,

Tim

Am 17.05.2013 13:24, schrieb Tamás Nepusz:
Hi,

My matrix el looks like this
V1      V2
12345   29999
29999   34567
76543   NA

[...]
After having got that error I tried to replace the NAs with the same vertix id, 
so that I would get an edge like 1234 1234
However, this results in loop-edges and not isolates.
You can get rid of the loop edges using simplify(g, remove.multiple=FALSE, 
remove.loops=TRUE) -- this will probably achieve what you want. However, note that 
vertices in igraph are numbered continuously from 1 in the R interface, so if your matrix 
contains the three rows above, then you will end up with 76543 vertices. If this is not 
what you want, you can use graph.data.frame instead which will treat the vertex names in 
the data frame as *symbolic* names. In this case, igraph will make up the vertex IDs as 
it goes and the corresponding names will be stored in the "name" vertex 
attribute.

Best,
Tamas
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help




reply via email to

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