The function defines a network object either from a nodeset or
from a matrix (sociomatrix or adjacency matrix). If a matrix is used as
input, defineNetwork()
returns a network filled with the same values
as the ones present in the provided network.
If the nodeset is the only argument, defineNetwork()
returns an
empty network with the number of columns and rows corresponding to the
size of the nodeset.
These networks are static, but they can be turned into dynamic networks
by linking dynamic events to the network objectw using linkEvents()
.
defineNetwork(
matrix = NULL,
nodes,
nodes2 = NULL,
directed = TRUE,
envir = environment()
)
An initial matrix (optional), and object of class matrix
.
A node-set (see defineNodes()
).
A second optional node-set for the definition of two-mode networks.
A logical value indicating whether the network is directed.
An environment object where the nodes-set objects are
defined. The default value is environment()
.
an object with additional class network.goldfish
with attributes:
a character vector with the names of the nodes set objects used
during the definition. nodes
and nodes2
arguments.
Logical value indicating whether the network is directed.
directed
argument
An empty character vector. linkEvents()
is used to
link event data frames.
The object can be modified using methods for matrix.
If a matrix is used as input, its dimension names must be a subset of the
nodes in the nodeset as defined with the defineNodes()
and the order of
the labels in rows and columns must correspond to the order of node labels
in the nodeset.
The matrix can be directed or undirected (as specified with the
directed
argument).
If the network is updated over time (e.g., a new wave of friendship data is
collected), these changes can be added with the linkEvents()
- similar to
link changing attribute events to a nodeset.
This time, the user needs to provide the network and the associated nodeset.
If no matrix is provided, goldfish only considers the nodeset and assumes
the initial state to be empty (i.e., a matrix containing only 0s).