network
objects.
network(x, vertex.attr=NULL, vertex.attrnames=NULL, directed=TRUE, hyper=FALSE, loops=FALSE, multiple=FALSE, bipartite = FALSE, ...)
network.copy(x)
as.network(x, ...)
is.network(x)
"print"(x, matrix.type = which.matrix.type(x), mixingmatrices = FALSE, na.omit = TRUE, print.adj = FALSE, ...)
"summary"(object, na.omit=TRUE, mixingmatrices=FALSE, print.adj = TRUE, ...)
network
, a matrix giving the network structure
in adjacency, incidence, or edgelist form; otherwise, an
object of class network
."adjacency"
, "edgelist"
, "incidence"
. See edgeset.constructors
for details and optional additional argumentsnetwork
.network
?network
, as.network
, and print.network
all return a network class object; is.network
returns TRUE or FALSE.
network
constructs a network
class object from a matrix representation. If the matrix.type
parameter is not specified, it will make a guess as to the intended edgeset.constructors
function to call based on the format of these input matrices. If the class of x
is not a matrix, network construction can be dispatched to other methods. For example, If the ergm
package is loaded, network()
can function as a shorthand for as.network.numeric
with x
as an integer specifying the number of nodes to be created in the random graph.
If the ergm
package is loaded, network
can function as a shorthand for as.network.numeric
if x
is an integer specifying the number of nodes. See the help page for as.network.numeric
in ergm
package for details. network.copy
creates a new network
object which duplicates its supplied argument. (Direct assignment with <-
should be used rather than network.copy
in most cases.)
as.network
tries to coerce its argument to a network, using the as.network.matrix
functions if x
is a matrix. (If the argument is already a network object, it is returned as-is and all other arguments are ignored.)
is.network
tests whether its argument is a network (in the sense that it has class network
).
print.network
prints a network object in one of several possible formats. It also prints the list of global attributes of the network.
summary.network
provides similar information.
network.initialize
, attribute.methods
, as.network.matrix
, as.matrix.network
, deletion.methods
, edgeset.constructors
, network.indicators
, plot.network
m <- matrix(rbinom(25,1,.4),5,5)
diag(m) <- 0
g <- network(m, directed=FALSE)
summary(g)
h <- network.copy(g) #Note: same as h<-g
summary(h)
Run the code above in your browser using DataLab