File: network.density.Rd

package info (click to toggle)
r-cran-network 1.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,500 kB
  • sloc: ansic: 2,491; sh: 13; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 1,880 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/misc.R
\name{network.density}
\alias{network.density}
\title{Compute the Density of a Network}
\usage{
network.density(x, na.omit = TRUE, discount.bipartite = FALSE)
}
\arguments{
\item{x}{an object of class \code{network}}

\item{na.omit}{logical; omit missing edges from extant edges when assessing
density?}

\item{discount.bipartite}{logical; if \code{x} is bipartite, should
\dQuote{forbidden} edges be excluded from the count of potential edges?}
}
\value{
The network density.
}
\description{
\code{network.density} computes the density of its argument.
}
\details{
The density of a network is defined as the ratio of extant edges to
potential edges. We do not currently consider edge values; missing edges are
omitted from extent (but not potential) edge count when
\code{na.omit==TRUE}.
}
\section{Warning }{
 \code{network.density} relies on network attributes (see
\link{network.indicators}) to determine the properties of the underlying
network object.  If these are set incorrectly (e.g., multiple edges in a
non-multiplex network, network coded with directed edges but set to
\dQuote{undirected}, etc.), surprising results may ensue.
}

\examples{

#Create an arbitrary adjacency matrix
m<-matrix(rbinom(25,1,0.5),5,5)
diag(m)<-0

g<-network.initialize(5)    #Initialize the network
network.density(g)          #Calculate the density

}
\references{
Butts, C. T.  (2008).  \dQuote{network: a Package for Managing
Relational Data in R.} \emph{Journal of Statistical Software}, 24(2).
\doi{10.18637/jss.v024.i02}

Wasserman, S. and Faust, K.  (1994).  \emph{Social Network Analysis: Methods
and Applications.} Cambridge: Cambridge University Press.
}
\seealso{
\code{\link{network.edgecount}}, \code{\link{network.size}}
}
\author{
Carter T. Butts \email{buttsc@uci.edu}
}
\keyword{graphs}