A directed graph with four nodes and four edges.
In all cases the graph is explicitly declared with ellipse shaped nodes. The dot file edges are declared in alphabetical order as this is the (assumed) default for how Rgraphviz will pass edges internally to graphviz.
Dot file for graphviz:
|
R code for Rgraphviz and gridGraphviz: # load Rgraphviz library library(Rgraphviz) # nodes nodes <- c("a", "b", "c", "d") # edges edgeList <- list(a=list(edges=c("b")), b=list(edges=c("c")), c=list(edges=c("d")), d=list(edges=c("a"))) # graph graph <- new("graphNEL", nodes=nodes, edgeL=edgeList, edgemode="directed") # Ragraph rag3 <- agopen(graph, "", attrs=list(node=list(shape="ellipse"))) |
graphviz |
Rgraphviz |
gridGraphviz (old) |
gridGraphviz (new) |
|
# create Ragraph object rag <- agopen(graph, "", attrs=list(node=list(shape="ellipse"))) #plot plot(rag) |
library(gridGraphviz) # create Ragraph object rag <- agopen(graph, "", attrs=list(node=list(shape="ellipse"))) #plot grid.graph(rag) ## Warning: Unsupported node shape; using 'box' ## Warning: Unsupported node shape; using 'box' ## Warning: Unsupported node shape; using 'box' ## Warning: Unsupported node shape; using 'box' |
library(gridGraphviz) # create Ragraph object rag <- agopenTrue(graph, "", attrs=list(node=list(shape="ellipse"))) #plot grid.graph(rag) |
gridGraphviz (old) fails to produce ellipse shaped nodes.