[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] another graph.incidence problem. It ignores mode argument
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] another graph.incidence problem. It ignores mode argument |
Date: |
Mon, 8 Jun 2009 20:06:24 +0200 |
Jose, thanks again, this is another bug, graph.incidence is far from
perfect it seems.... I corrected it. graph.incidence() simply ignored
'mode' for sparse matrices.
A workaround would be to transpose the incidence matrix, or call
as.undirected() afterwards, if an undirected matrix is desired.
Thanks, Best,
Gabor
On Mon, Jun 8, 2009 at 4:35 PM, Jose Quesada<address@hidden> wrote:
> Hi Gabor, Tamas, (all)
>
> M <- new("dgCMatrix", Dim = 2:3, p = as.integer(c(0,1,1,3)),
> i = c(1L, 1:0), x= c(2,2,1))
>
> g = graph.incidence(M, directed=T, mode="in")
>
>> print(g)
> Vertices: 5
> Edges: 3
> Directed: TRUE
> Edges:
>
> [0] 1 -> 2
> [1] 0 -> 4
> [2] 1 -> 4
>>
>> g = graph.incidence(M, directed=T, mode="out")
>>
>> print(g)
>
> Vertices: 5
> Edges: 3
> Directed: TRUE
> Edges:
>
> [0] 1 -> 2
> [1] 0 -> 4
> [2] 1 -> 4
>
> Well, should the direction be reversed in the second one?
> Thanks!
>
> Best,
> -Jose
>
> --
> Jose Quesada, PhD.
> Max Planck Institute,
> Center for Adaptive Behavior and Cognition -ABC-,
> Lentzeallee 94, office 224, 14195 Berlin
> http://www.josequesada.name/
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
--
Gabor Csardi <address@hidden> UNIL DGM