[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] Thoughts on consistency in functions
From: |
Magnus Torfason |
Subject: |
[igraph] Thoughts on consistency in functions |
Date: |
Fri, 30 Oct 2009 12:26:52 -0400 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
I just sent in the functions 'get.edges.as.data.frame()' and
'get.vertices.as.data.frame()'. While writing them I thought that there
really should exist two functions, get.edges() and get.vertices() that
return the information in the simplest structures possible (matrix for
get.edges() and vector for get.vertices()). The functions could have the
following definitions (with defaults chosen for backwards compatibility
and consistency):
get.edges <- (graph, es=E(graph), names=FALSE) {...}
get.vertices <- (graph, vs=V(graph), names=FALSE) {...}
Then, get.edgelist() could be deprecated and its definition could also
be simplified:
get.edgelist <- (graph, names=TRUE)
{
get.edges(graph, es=E(graph), names=names)
}
This is just a thought, I may be missing some detail about the
difference between get.edges() and get.edgelist(), and there may be
performance implications, but I thought I'd share it anyway.
Best,
Magnus
- [igraph] Thoughts on consistency in functions,
Magnus Torfason <=