network.density: Compute the Density of a Network

Description Usage Arguments Details Value Warning Author(s) References See Also Examples

Description

network.density computes the density of its argument.

Usage

1
network.density(x, na.omit=TRUE, discount.bipartite=FALSE)

Arguments

x

an object of class network

na.omit

logical; omit missing edges from extant edges when assessing density?

discount.bipartite

logical; if x is bipartite, should “forbidden” edges be excluded from the count of potential edges?

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 na.omit==TRUE.

Value

The network density.

Warning

network.density relies on network attributes (see 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 “undirected”, etc.), surprising results may ensue.

Author(s)

Carter T. Butts buttsc@uci.edu

References

Butts, C. T. (2008). “network: a Package for Managing Relational Data in R.” Journal of Statistical Software, 24(2). http://www.jstatsoft.org/v24/i02/

Wasserman, S. and Faust, K. (1994). Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.

See Also

network.edgecount, network.size

Examples

1
2
3
4
5
6
#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

Example output

network: Classes for Relational Data
Version 1.15 created on 2019-04-01.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
                    Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Martina Morris, University of Washington
                    Skye Bender-deMoll, University of Washington
 For citation information, type citation("network").
 Type help("network-package") to get started.

[1] 0

network documentation built on May 2, 2019, 5:16 p.m.