0

I have a lot of .net files, and the package tutorial says it is possible to use this format with sna.

My error message is:

> Error in FUN(X[[1L]], ...) :    as.edgelist.sna input must be an
> adjacency matrix/array, edgelist matrix, network, or sparse matrix, or
> list thereof.

How can I open .net files with sna package in R? I browsed the net but I couldn't find any helpful information to my problem.

I have no problem with using package igraph, but there are some pros to use package sna, too.

Thank you in advance.

P.S. I tried to read pajek with library(network):

b1<- read.paj("15.net")
Warning message:
In readLines(file, 1, ok = TRUE) : incomplete final line found on '15.net'
Übel Yildmar
  • 491
  • 1
  • 9
  • 24
  • Did reading the file with `network::read.paj` work? It should have. The warning about the incomplete final line is unimportant here. – Fr. Jan 03 '17 at 02:33

1 Answers1

0

If it works with 'igraph', do it with 'igraph'. Then convert the data to a form acceptable by functions in the 'sna' package. For example with asNetwork function from package 'intergraph' you can convert igraph object to a network object (package 'network'), which you can use with 'sna'.

Michał
  • 2,755
  • 1
  • 17
  • 20