network.update {ergm} | R Documentation |
Replaces the sociomatrix in a network object with the sociomatrix specified by
newmatrix
.
See ergm
for more information.
network.update(nw, newmatrix, matrix.type=NULL, output="network")
nw |
a |
newmatrix |
Either an adjacency matrix (a matrix of zeros and ones indicating the presence of a tie from i to j) or an edgelist (a two-column matrix listing origin and destination node numbers for each edge; note that in an undirected matrix, the first column should be the smaller of the two numbers). |
matrix.type |
One of "adjacency" or "edgelist" telling which type of
matrix |
output |
Currently unused. |
network.update
returns a network
object.
ergm, network
# data(florentine) # # test the network.update function # # Create a Bernoulli network rand.net <- network(network.size(flomarriage)) # store the sociomatrix rand.mat <- rand.net[,] # Update the network network.update(flomarriage, rand.mat) # Try this with an edgelist rand.mat <- as.matrix.network.edgelist(flomarriage)[1:5,] network.update(flomarriage, rand.mat)