\HeaderA{degree}{Degree and degree distribution of the vertices}{degree}
\methaliasA{degree.distribution}{degree}{degree.distribution}
\keyword{graphs}{degree}
\begin{Description}\relax
The degree of a vertex is its most basic structural
property, the number of its adjacent edges.
\end{Description}
\begin{Usage}
\begin{verbatim}
degree(graph, v=V(graph), mode = c("all", "out", "in", "total"), loops = TRUE) 
degree.distribution(graph, cumulative = FALSE, ...) 
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{graph}] The graph to analyze.
\item[\code{v}] The ids of vertices of which the degree will be calculated.
\item[\code{mode}] Character string, \dQuote{out} for out-degree, \dQuote{in} for
in-degree or \dQuote{total} for the sum of the two. For undirected
graphs this argument is ignored.
\item[\code{loops}] Logical; whether the loop edges are also counted.
\item[\code{cumulative}] Logical; whether the cumulative degree distribution
is to be calculated.
\item[\code{...}] Additional arguments to pass to \code{degree},
eg. \code{mode} is useful but also \code{v} and \code{loops} make
sense.
\end{ldescription}
\end{Arguments}
\begin{Value}
For \code{degree} a numeric vector of the same length as argument
\code{v}.

For \code{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.
\end{Value}
\begin{Author}\relax
Gabor Csardi \email{csardi@rmki.kfki.hu}
\end{Author}
\begin{Examples}
\begin{ExampleCode}
g <- graph.ring(10)
degree(g)
g2 <- erdos.renyi.game(1000, 10/1000)
degree.distribution(g2)
\end{ExampleCode}
\end{Examples}

