Skip to contents

Count the number of nodes or edges in a network

Usage

n_nodes(x, focused = FALSE)

n_edges(x, focused = FALSE)

Arguments

x

An object of class sfnetwork, or any other network object inheriting from igraph.

focused

Should only features that are in focus be counted? Defaults to FALSE. See focus for more information on focused networks.

Value

An integer.

Examples

net = as_sfnetwork(roxel)
n_nodes(net)
#> [1] 987
n_edges(net)
#> [1] 1215