Skip to contents

Returns the number of nodes in a cograph_network.

Usage

n_nodes(x)

Arguments

x

A cograph_network object.

Value

Integer: number of nodes.

Examples

mat <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)
net <- as_cograph(mat)
n_nodes(net)  # 3
#> [1] 3