Update the edges in a network based on a matrix
Replaces the edges in a network
object with the edges corresponding
to the sociomatrix or edge list specified by new
.
## S3 method for class 'network' update( object, new, matrix.type = NULL, attrname = NULL, ..., ignore.nattr = c("bipartite", "directed", "hyper", "loops", "mnext", "multiple", "n"), ignore.vattr = c() )
object |
a |
new |
Either an adjacency matrix (a matrix of values indicating the presence and/or the value of a tie from i to j) or an edge list (a two-column matrix listing origin and destination node numbers for each edge, with an optional third column for the value of the edge). |
matrix.type |
One of |
attrname |
For a network with edge weights gives the name of the edge attribute whose names to set. |
... |
Additional arguments; currently unused. |
ignore.nattr |
Character vector of the names of network-level attributes to ignore when updating network objects (defaults to standard network properties). |
ignore.vattr |
Character vector of the names of vertex-level attributes to ignore when updating network objects. |
A new network
object with the edges specified by
new
and network and vertex attributes copied from
the input network object
. Input network is not modified.
# 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 update(flomarriage, rand.mat, matrix.type="adjacency") # Try this with an edgelist rand.mat <- as.matrix.network.edgelist(flomarriage)[1:5,] update(flomarriage, rand.mat, matrix.type="edgelist")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.