无法使用R'network'包将paj文件作为网络对象读取

时间:2014-08-28 20:19:02

标签: r statnet

我有一堆文件格式.net的pajek网络,但不能再使用read.paj从网络包导入了。它在Windows下工作。有人能伸出援手吗?

read.paj(file.path)仅返回NULL

read.paj函数中的debug = True下的输出:

[1] "nextline called... new loop started"
[1] "vertex list set"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "arc or edge lines present"
[1] "length of dyad list 0"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "nextline called... new loop started"
[1] "arc or edge lines present"
[1] "length of dyad list 0"
[1] "nextline called... new loop started"
[1] "nnetworks= 0"
[1] "network.names= "
[1] "vertex null? FALSE"
[1] "network.title= 0"
[1] "vector null? TRUE"
[1] "colnames.vector= "
[1] "projects null? TRUE"
[1] "nprojects= 0"
[1] "names.projects= "
[1] "number of networks 0"
[1] "number of projects 0"
####### .net文件内容
*Vertices 19

1 "1"

2 "2"

3 "3"

4 "4"

5 "5"

6 "6"

7 "7"

8 "8"

9 "9"

10 "10"

11 "11"

12 "12"

13 "13"

14 "14"

15 "15"

16 "16"

17 "17"

18 "18"

19 "19"

*Edges

1 2   

1 6

1 7

1 16

1 18

2 6

2 7

2 11

2 15

2 18

3 5

3 8

3 14

3 15

3 16

4 5

4 6

4 8

4 13

4 14

4 16

4 19

6 7

6 8

6 11

6 13

6 14

6 18

6 19

7 9

7 10

7 11

7 12

7 14

7 15

7 18

7 19

8 11

8 13

8 14

8 15

8 19

9 10

9 11

9 12

9 15

9 19

10 11

10 12

10 15

10 16

10 17

10 19

11 12

11 13

11 14

11 15

11 18

11 19

12 15

12 19

13 14

13 18

13 19

14 15

14 16

14 18

14 19

15 19

16 17

16 19

17 19

18 19

1 个答案:

答案 0 :(得分:1)

我不确定为什么来自“网络”的read.paj不起作用...但是您可以尝试从“igraph”包中read.graph然后从包中使用asNetwork “intergraph”将数据作为类网络的对象:

library(igraph)
g <- read.graph("z.net", format="pajek")   # that's your file
g

# IGRAPH U--- 19 73 -- 
# + attr: id (v/c)


library(network)
library(intergraph)
net <- asNetwork(g)
net

# Network attributes:
#  vertices = 19 
#  directed = FALSE 
#  hyper = FALSE 
#  loops = FALSE 
#  multiple = FALSE 
#  bipartite = FALSE 
#  total edges= 73 
#    missing edges= 0 
#    non-missing edges= 73 
#
# Vertex attribute names: 
#    id vertex.names 
#
# No edge attributes