R network package - is there a faster way to add edges? -


i have adjacency matrix (m) of 7000 nodes. creating network using

n <- 7000 m <- matrix(rbinom(3*n, 1, 0.2), n,n) diag(m) <- 0 g <- network(m, directed = f) 

is slow. there more efficient way of creating large random networks in r? alternative methods such using igraph appreciated.

with igraph, can do:

library('igraph') g <- graph.adjacency(m, mode='undirected') 

the edges can retrieved using e(g) , vertices using v(g).

check out igraph docs more information.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -