Skip to content
Prev 2388 / 21312 Next

[Bioc-devel] efficient use of edgeData (graph)

In the RCytoscape package I have a convenience function which returns the values of a specified edge attribute, for all edges in the graph.  It is ponderously slow on a graph of 9000 edges.

I define it this way:

function (graph, edge.attribute.name) {
  unlist (sapply (names (edgeData (graph)), function (n) edgeData (graph)[[n]][[edge.attribute.name]]))
  }

Can anyone suggest ways to speed this up?   I fear I am missing something obvious.

Thanks!

 - Paul