nvertex {ergmito}R Documentation

Utility functions to query network dimensions

Description

Utility functions to query network dimensions

Usage

nvertex(x)

nedges(x, ...)

nnets(x)

is_directed(x, check_type = FALSE)

Arguments

x

Either an object of class ergmito, network, formula, or matrix.

...

Further arguments passed to the method. Currently only nedges.network receives arguments (see network::network.edgecount).

check_type

Logical scalar. When checking for whether the network is directed or not, we can ask the function to return with an error if what we are checking is not an object of class network, otherwise it simply returns false.

Value

is_directed checks whether the passed networks are directed using the function is.directed. In the case of multiple networks, the function returns a logical vector. Only objects of class network can be checked, otherwise, if check_type = FALSE, the function returns TRUE by default.

Examples

set.seed(771)
net <- lapply(rbernoulli(c(4, 4)), network::network, directed = FALSE)
is_directed(net)
is_directed(net[[1]])
is_directed(net ~ edges)
## Not run: 
  is_directed(net[[1]][1:4, 1:4], check_type = TRUE) # Error

## End(Not run)
is_directed(net[[1]][1:4, 1:4])

[Package ergmito version 0.3-1 Index]