|
From: | Martin Tomko |
Subject: | Re: [igraph] getting the graph of the maximum component |
Date: | Mon, 09 Aug 2010 10:39:35 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100227 Lightning/1.0b1 Thunderbird/3.0.3 |
Excellent, thanks.I am running into a weird behaviour using the approach you mentioned for the identification of the max component. When I modified my code on my local machine ("R version 2.9.0 (2009-04-17)") if(is.connected(g)==FALSE) g <- subgraph(g, which(c$membership==which.max(c$csize)-1)-1);
this works perfectly, with igraph: packageDescription(pkg="igraph")$Version [1] "0.5.2-2"When run on the server, where I have ("R version 2.10.0 (2009-10-26)"), the same command on the same network results into an error:
"H:/Res/inputs/eis.net" Fehler in c$membership : $ operator is invalid for atomic vectors packageDescription(pkg="igraph")$Version [1] "0.5.3"I was first getting the same error locally, but then I added the condition statement if(is.connected(g)==FALSE) and that solved it. But not under the new version. Am I missing something? I am happy to share the .net wile if that would help...
Cheers, and thaks so much for helping me out with this, Martin On 8/9/2010 10:21 AM, Gábor Csárdi wrote:
Martin, they are added as the 'id' vertex attribute. Gabor On Mon, Aug 9, 2010 at 10:10 AM, Martin Tomko<address@hidden> wrote:Ok, cool. If i create the graph from a pajek net file with assigned ids, these I preserved, I assume? Or are they only used as "labels"? Cheers M. On 8/9/2010 10:03 AM, Gábor Csárdi wrote:Hi Martin, On Mon, Aug 9, 2010 at 9:56 AM, Martin Tomko<address@hidden> wrote:Hi Gabor,# thanks a lot, that helps heaps. I tend to forget the R tricks, I don't work with it on a daily basis. Just one question - you note that igraph has 0-based indexing (as opposed to R starting with 1). I just want to make sure I get this right, it can potentially mean that I missed some data in my processing. Where is it manifested, or where can I find it documented?vertex and edge ids are indexed from zero. Possibly other ids as well, e.g. membership vectors for community finding algorithms and clusters(). This is documented in the manual, see help("igraph-package"), and the respective manual pages of the other functions, e.g. help("clusters"). Best, Gabor [...]-- Martin Tomko Postdoctoral Research Assistant Geographic Information Systems Division Department of Geography University of Zurich - Irchel Winterthurerstr. 190 CH-8057 Zurich, Switzerland email: address@hidden site: http://www.geo.uzh.ch/~mtomko mob: +41-788 629 558 tel: +41-44-6355256 fax: +41-44-6356848
-- Martin Tomko Postdoctoral Research Assistant Geographic Information Systems Division Department of Geography University of Zurich - Irchel Winterthurerstr. 190 CH-8057 Zurich, Switzerland email: address@hidden site: http://www.geo.uzh.ch/~mtomko mob: +41-788 629 558 tel: +41-44-6355256 fax: +41-44-6356848
[Prev in Thread] | Current Thread | [Next in Thread] |