2010-11-09 100 views
0

内这里是我的代码与相应的输出tkplot中的igraph [R

> tkplot(g.2,vertex.label=nodes, 
+ canvas.width=700, 
+ canvas.height=700) 
[1] 6 

> ?tkplot 
Warning message: 
In rm(list = cmd, envir = .tkplot.env) : object 'tkp.6' not found 

我得到这个错误,不管我构建和看我的阴谋后什么命令。

这可能是显而易见的,但我无法从图中获取数据。

> tkp.6.getcoords 
Error: object 'tkp.6.getcoords' not found 

有什么想法?在Windows 2007 Pro上。

回答

1

R是一种功能性编程语言。 tkplot有点奇怪(对于R用户来说),因为它将数字句柄返回给它的创作。试试这个:

tkplot.getcoords(6) 

当我运行tkplot页面上的例子,我再从tkplot.getcoords得到这个(1),因为它是我第一次的igraph情节:

> tkplot.getcoords(1) 
      [,1]  [,2] 
[1,] 334.49319 33.82983 
[2,] 362.43837 286.10754 
[3,] 410.61862 324.98319 
[4,] 148.00673 370.91116 
[5,] 195.69191 20.00000 
[6,] 29.49197 430.00000 
[7,] 20.00000 155.05409 
[8,] 388.51103 62.61010 
[9,] 430.00000 133.44695 
[10,] 312.76239 168.90260