|
From: | Magnus Torfason |
Subject: | Re: [igraph] Thoughts on consistency in functions |
Date: | Mon, 02 Nov 2009 12:56:05 -0500 |
User-agent: | Thunderbird 2.0.0.23 (Windows/20090812) |
Gábor Csárdi wrote:
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'.
Yes, I would choose to return the numeric IDs, since that is how get.edgelist() works currently. It is of course also true that name does not always exist, but it is a very special attribute nevertheless, and created automatically for many types of graphs.
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.
Well, I think it's a great system, and I'm *not* advocating a total redesign. The idea was to offer some ideas on low-hanging fruit (meaning seemingly trivial to implement, *and* backwards compatible) that would make parts of it more consistent.
Thanks for everything, and keep up the good work! Best, Magnus
[Prev in Thread] | Current Thread | [Next in Thread] |