gsize: The size of the graph (number of edges)

Description Usage Arguments Value See Also Examples

View source: R/interface.R

Description

ecount of an alias of this function.

Usage

1

Arguments

graph

The graph.

Value

Numeric scalar, the number of edges.

See Also

Other structural queries: [.igraph(), [[.igraph(), adjacent_vertices(), are_adjacent(), ends(), get.edge.ids(), gorder(), head_of(), incident_edges(), incident(), is_directed(), neighbors(), tail_of()

Examples

1
2
3
4
5
6
7
g <- sample_gnp(100, 2/100)
gsize(g)

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

Example output

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

[1] 98

igraph documentation built on Jan. 8, 2021, 2:19 a.m.

Related to gsize in igraph...