Question: Read Graphviz file .dot in R
0
gravatar for pleaseteachmehowtodoit
3.1 years ago by

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 

 

rgraphviz R rstudio graphviz .dot • 914 views
ADD COMMENTlink modified 3.1 years ago • written 3.1 years ago by pleaseteachmehowtodoit0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 271 users visited in the last hour