|
From: | Thiago M. Venancio |
Subject: | Re: [igraph] extracting lists |
Date: | Mon, 26 Jan 2009 18:46:33 -0500 |
Hi,On Mon, Jan 26, 2009 at 10:23 PM, Thiago M. Venancio
<address@hidden> wrote:
> Hi all,
>
> After loading the graph in R, I would like to extract the list with vertices
> names and their degrees.
> I know how to save both variables in vectors, however they seem to be in
> different orders. For example, the degree of the first element in the vector
> with vertices names is not allocated in the first position in the degree
> vector.
> Here is what I am doing:
>
> graph = read.graph("graph.txt", format="ncol")
> deg = degree(graph)
> vec = V(graph)
it is hard to guess what is in 'graph.txt', but 'deg' and 'vec' are
"in order" here, i.e. deg[1] belongs to vec[1], etc.
You need to give us a reproducible example to see what goes wrong for you.
Gabor
> _______________________________________________
> Any help is appreciated.
>
> Best,
>
> Thiago
>
>
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
--
Gabor Csardi <address@hidden> UNIL DGM
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |