igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Thoughts on consistency in functions


From: Gábor Csárdi
Subject: Re: [igraph] Thoughts on consistency in functions
Date: Sat, 31 Oct 2009 11:28:13 +0100

Magnus,

I think that V(g) and E(g) do almost exactly what you want. Also,
don't forget that we don't always have V(g)$name, so for graphs
without the 'name' vertex attribute, we would need to return the
numeric ids, or give an error message if 'names=TRUE'.

But you are right, that the whole system could benefit from a
redesign. More precisely, a design, as it was never designed properly,
it only evolved to its current state. E.g. it would be great to have
named graphs with checking the uniqueness of the names, maybe names
should be just factors in R, etc. The current interface in clumsy, no
doubt.

Thanks for the ideas, they are always welcome, Best Regards,
Gabor

On Fri, Oct 30, 2009 at 9:07 PM, Magnus Torfason <address@hidden> wrote:
>> Magnus Torfason wrote:
>>> get.vertices <- (graph, vs=V(graph), names=FALSE) {...}
>
> Gábor Csárdi wrote:
>>
>> What would get.vertices do?
>
> get.vertices(g,V(g),FALSE) would return the same as as.vector(V(g))
> get.vertices(g,V(g),TRUE)  would return the same as V(g)$name
>
> Like I said, the thoughts were on consistency (not on new functionality).
> People will differ on the usefulness of that, but I wanted to share my
> thoughts regardless (and without any hard feelings if people disagree :-).
>
> Best,
> Magnus
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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