Count the number of vertices in the graph

count_vertices(x)

Arguments

x

graph

Value

integer

Details

Returns the number of vertices in an object of class network or igraph.

Examples

net <- igraph::random.graph.game(10, p.or.m = .15, type = "gnp")
count_vertices(net)
#> [1] 10

net <- sna::rgraph(n = 10, tprob = 0.15) |> network::as.network()
count_vertices(net)
#> [1] 10