0

My question is regarding plotting with R using the igraph and tcltk packages. I installed everything, including XQuartz for my Mac OS X 10.10. When I try to plot it, first it starts the interactive window but then immediately crashes with error "1 1". Has anyone had this? Not sure if this is a mac issue or generally an R issue. When I plot it using just the "plot", i.e. not interactively (not "tkplot") - it works.

Basically I want to plot this network but interactively so I can drag the vertices and edges to make the plot better (this is the output of my script if I just do "plot" instead of "tkplot"):

enter image description here

PS: my R version is 3.2.1, igraph version is 1.0.1

PPS: I am running this script using "Rscript script.r" command in terminal.

Here is my code:

library(tcltk)
library(igraph)
el=read.table("myfilename")
el[,1]=as.character(el[,1])
el[,2]=as.character(el[,2])
el=as.matrix(el)
g=graph.edgelist(el[,1:2])
E(g)$weight=as.numeric(el[,3])
V(g)$size=degree(g)*2
V(g)$color <- "white"
E(g)$color <- "black"
a=read.table("somenamesfile",header=TRUE)
V(g)$group=as.character(a$group[match(V(g)$name,a$number)])
tkplot(g,layout=layout.fruchterman.reingold,edge.width=E(g)$weight*300,edge.arrow.size=0.0,vertex.label=V(g)$group)
  • Several people have reported to the R-SIG-Mac mailing list that `tkrplot` crashes (segfaults) on the new versions. I've seen no reports of fixes. – IRTFM Jul 14 '15 at 23:49
  • This is unfortunately not a reproducible example, I cannot run it. :( – Gabor Csardi Jul 15 '15 at 13:23
  • @GaborCsardi this is not reproducible because I didn't provide my input files. "myfilename" is just the values of the vertices (first 2 columns) and edges (3rd column) (i.e. transitions between vertices): 0 9 0.0738654522211569 9 0 0.0738255033557047 26 17 0.0713886225631192 17 26 0.0713087248322148 1 0 0.0683525087887504 0 1 0.0681527644614893 and the "names file are names of vertices: 26 LLL 25 ELL – user3290846 Jul 15 '15 at 21:52
  • and also instead of the "tkplot" at the end I used "plot" to generate that graph. Would you know any other way of making my plot interactive so I can drag the edges and vertices and make it better looking? – user3290846 Jul 15 '15 at 21:52

0 Answers0