igraph-help
[Top][All Lists]

## Re: [igraph] Question on subgraph and subset

 From: Peter Flom Subject: Re: [igraph] Question on subgraph and subset Date: Mon, 9 Apr 2012 15:04:05 -0400

```OK, thanks

I will play around some more and try to figure it out

Peter Flom
Peter Flom Consulting
http://www.statisticalanalysisconsulting.com/
http://www.IAmLearningDisabled.com

-----Original Message-----
On Behalf Of Gábor Csárdi
Sent: Monday, April 09, 2012 3:02 PM
To: Help for igraph users
Subject: Re: [igraph] Question on subgraph and subset

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
> 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
> https://lists.nongnu.org/mailman/listinfo/igraph-help

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

_______________________________________________
igraph-help mailing list