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


library(Rgraphviz)
set.seed(123)
V <- letters[1:5]
M <- 1:2
g1 <- randomGraph(V, M, 0.5)
edgemode(g1) <- "directed"
x <- layoutGraph(g1)

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

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



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.