How does one go about creating a "graph stack" in the network class for SNA commands that accept more than one graph? According to the documentation a graph stack should be of dimension m x N x N. I tried to create one as follows, but I get an error:
library(network)
a <- array(NA,dim=c(2,10,10))
a[1,,]<- matrix(sample(c(0,1),100,replace=T),10,10)
a[2,,]<- matrix(sample(c(0,1),100,replace=T),10,10)
t <- network(a,matrix.type="adjacency")
Creating a random graph with the rgraph
function creates an array with a similar structure:
library(sna)
b <-rgraph(10,2,tprob=c(0.2,0.8))
But first creating the structure and then attempting to turn it into a network object doesn't work.
Related: is there a way to make a network object with networks of different sizes? The documentation also seems to suggest that a network object can be a list of other network objects.