Thanks to visit codestin.com
Credit goes to r.igraph.org

Skip to contents

ecount() and gsize() are aliases.

Usage

gsize(graph)

ecount(graph)

Arguments

graph

The graph.

Value

Numeric scalar, the number of edges.

Examples

g <- sample_gnp(100, 2 / 100)
gsize(g)
#> [1] 81
ecount(g)
#> [1] 81

# Number of edges in a G(n,p) graph
replicate(100, sample_gnp(10, 1 / 2), simplify = FALSE) %>%
  vapply(gsize, 0) %>%
  hist()