powered by
Returns the number of nodes in a cograph_network.
n_nodes(x)
Integer: number of nodes.
A cograph_network object.
as_cograph, n_edges, get_nodes
as_cograph
n_edges
get_nodes
mat <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3) net <- as_cograph(mat) n_nodes(net) # 3
Run the code above in your browser using DataLab