igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Question on subgraph and subset


From: Gábor Csárdi
Subject: Re: [igraph] Question on subgraph and subset
Date: Mon, 9 Apr 2012 15:02:21 -0400

I _guess_ it is a zero-based indexing error. igraph vertices and edges
are indexed from zero in the 0.5.x version and R vectors are indexed
from 1, and this might cause the difference. But hard to say.

G.

On Mon, Apr 9, 2012 at 2:47 PM, Peter Flom
<address@hidden> wrote:
> Hi again
>
> I tried to make up a toy example, but 30 minutes of trying failed to
> reproduce anything useful
>
> However, in this code:
>
>> Code:
>> vs <- subcomponent1
>> component <- subgraph(g50, vs)
>> traitscomponent <- subset(traits50, traits$Position %in% vs)
>>
>> After which traitscomponent has 37879 rows while vs has length 37880.
>
> Subcomponent1 is the first column of a subcomponent of g50.  It is a vector
> of 37880 integers
> g50 is a graph with 42,943 rows. The vertices have attributes including
> "position" as the first.
> Traits50 is a data frame with 42,943 rows and 10 columns. The first column
> is "Position".
>
> Does that provide enough context?
>
> Peter
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help



-- 
Gabor Csardi <address@hidden>     MTA KFKI RMKI



reply via email to

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