# degree

From igraph v0.5.3
by Gabor Csardi

##### Degree and degree distribution of the vertices

The degree of a vertex is its most basic structural property, the number of its adjacent edges.

- Keywords
- graphs

##### Usage

```
degree(graph, v=V(graph), mode = c("all", "out", "in", "total"), loops = TRUE)
degree.distribution(graph, cumulative = FALSE, ...)
```

##### Arguments

- graph
- The graph to analyze.
- v
- The ids of vertices of which the degree will be calculated.
- mode
- Character string,
out for out-degree,in for in-degree ortotal for the sum of the two. For undirected graphs this argument is ignored. - loops
- Logical; whether the loop edges are also counted.
- cumulative
- Logical; whether the cumulative degree distribution is to be calculated.
- ...
- Additional arguments to pass to
`degree`

, eg.`mode`

is useful but also`v`

and`loops`

make sense.

##### Value

- For
`degree`

a numeric vector of the same length as argument`v`

.For

`degree.distribution`

a numeric vector of the same length as the maximum degree plus one. The first element is the relative frequency zero degree vertices, the second vertices with degree one, etc.

##### concept

- Vertex degree
- Degree distribution

##### Examples

```
g <- graph.ring(10)
degree(g)
g2 <- erdos.renyi.game(1000, 10/1000)
degree.distribution(g2)
```

*Documentation reproduced from package igraph, version 0.5.3, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.