Entering edit mode
Alexis Dinno
▴
20
@alexis-dinno-5665
Last seen 10.2 years ago
Hi,
I would love to integrate interoperability with Rgraphviz in my
LoopAnalyst
package on CRAN. Unfortunately, Rgraphiz does not seem to behave well
with
graphs read from dot files. The dot file
(http://doyenne.com/personal/files/Levins.dot) can be read an rendered
by
agread(), but does not turn out so nicely, presumably because of how
node, edge
and arrowhead attributes are handled.
Here's how dot from graphviz renders my graph:
http://doyenne.com/personal/files/Levins.png
But if in R I type:
g <- agread("/Users/Alexis/Desktop/Levins.dot")
plot(g)
I get: http://doyenne.com/personal/files/Levins2.png
So I would like to edit the various parameters according to Rgraphviz,
BUT, I
get the following errors with the following commands:
edgemode(g) <- "directed"
Error in function (classes, fdef, mtable) :
unable to find an inherited method for function ?edgemode<-? for
signature ?"Ragraph", "character"?
edgeRenderInfo(g) <- list(arrowhead=c("R~R"="dot", "R~H"="normal",
"H~R"="dot", "H~x"="normal", "H~y"="normal", "x~H"="dot", "y~H"="dot",
"y~y"="dot"), arrowtail="open")
Error in function (classes, fdef, mtable) :
unable to find an inherited method for function ?isDirected? for
signature ?"Ragraph"?
Can you help?
Thank you!
Alexis
Here's the content of Levins.dot:
digraph G {
graph [bgcolor = "transparent", size = "18!,18!", nodesep="1",
ranksep="1",
rankdir="LR"];
node [fixedsize=true, fontname="Sans", fontsize="70.85", shape=circle,
height="2", width="2", style="setlinewidth(5)"];
edge [style="setlinewidth(4)", arrowsize=3];
"R" [color="#8000BF"];
"R" -> "R" [color="#8000BF", arrowhead=dot];
"R" -> "H" [color="#8000BF"];
"H" [color="#0000BF"];
"H" -> "R" [color="#0000BF", arrowhead=dot];
"H" -> "x" [color="#0000BF"];
"H" -> "y" [color="#0000BF"];
"x" [color="#00BF00"];
"x" -> "H" [color="#00BF00", arrowhead=dot];
"y" [color="#BF0000"];
"y" -> "H" [color="#BF0000", arrowhead=dot];
"y" -> "y" [color="#BF0000", arrowhead=dot];
}