Donnerstag, 16. April 2009

Update in Rgraphviz package

Thanks to Florian and his colleagues work, Rgraphivz package now supports many more features native in Graphviz suite. For example, the arrowhead/arrowtail shapes can be now specified in the new framework of edgeRenderInfo. The following codes serve as an example

V <- letters[1:5]
M <- 1:2
g1 <- randomGraph(V, M, 0.5)
edgemode(g1) <- "directed"
x <- layoutGraph(g1)

edgeRenderInfo(x) = list(arrowhead = "tee")

edgeRenderInfo(x) = list(arrowhead = "diamond")

This feature is wonderful to illustrate biological interaction networks, since the shape of edges carries certain information.

P.S. Note that the edgeRenderInfo list can also be given in a per-Edge manner, that is, a list of shapes with names of edge.