There isn't much information out there about user experience with tkplot. It just crashes for me. I have R version 3.2.3 and igraph 1.0.1 I'm trying to run the script below, but I see tkplot flash for a split second, then it closes. I get the same behaviour with other tkplot examples. Any help is greatly appreciated. Does this script work for anyone?
library(igraph)
net <- graph( edges=c(1,2, 2,3, 3, 1), n=3, directed=F )
tkid <- tkplot(net) #tkid is the id of the tkplot that will open
l <- tkplot.getcoords(tkid) # grab the coordinates from tkplot
##tk_close(tkid, window.close = T)
plot(net, layout=l)
It seems like the problem is that I'm running this as a script like this:
R --vanilla < script.R
or
$ R script script.R
This is just an example, my actual script is really long. So How do I run it?