Read Graphviz file .dot in R
0
0
Entering edit mode
@pleaseteachmehowtodoit-10908
Last seen 6.3 years ago

I am trying to read this GraphViz file .dot in R and obtain a matrix with relevant information. After reading the file I will work on the matrix to obtain the output in specific format (I've worked a bit with matrices in R before and that is work I want and have to do). Instead of trying to parse and analyze the file from scratch, I'm trying to use an R package to speed it up.

The file was originally a .glm file GridLab-D converted through a ruby script to DOT file by Michael A. Cohen as he expains here. I am interested in obtaining parameters, especially "pos" for every element.

The code I've tried is:

    library(Rgraphviz)
g<-agread("R3-12.47-2.dot")
b<-str(g)

c<-lapply(g@AgNode, function(i) i@center)

From this output I can't obtain the information from the "pos" field.

I'm willing to learn, read, look and work a new solution, hopefully with some of your expertise it will be faster.

I'm open to other packages too if you think that it could be a better solution for this particular case.

Thanks in advance.

Note: RStudio version 0.99.902

r rstudio rgraphviz graphviz .dot • 1.5k views
ADD COMMENT

Login before adding your answer.

Traffic: 524 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6