% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dyad-census.R
\name{dyad_census}
\alias{dyad_census}
\title{Dyad Census}
\usage{
dyad_census(x, directed = NULL, ...)
}
\arguments{
\item{x}{Network input: matrix, igraph, network, cograph_network, or tna
object.}

\item{directed}{Logical or NULL. If NULL (default), auto-detect from matrix
symmetry. Set TRUE to force directed, FALSE to force undirected.}

\item{...}{Additional arguments passed to \code{\link{to_igraph}}.}
}
\value{
A tidy data.frame of class \code{"cograph_dyad_census"} with one row
per dyad type and columns:
\describe{
\item{type}{Character: \code{"mutual"}, \code{"asymmetric"}, or
\code{"null"}.}
\item{count}{Integer: number of dyads of that type.}
\item{proportion}{Numeric: count divided by the total number of dyads
(\eqn{n(n-1)/2}).}
}
The dyad-based reciprocity \eqn{2M / (2M + A)} is attached as the
\code{"reciprocity"} attribute.
}
\description{
Classifies every dyad (unordered pair of nodes) in a directed network into
one of three mutually exclusive states: \strong{mutual} (M, edges in both
directions), \strong{asymmetric} (A, an edge in exactly one direction), or
\strong{null} (N, no edge between the pair). The dyad census is the
dyad-level companion to \code{\link{triad_census}} and underlies dyad-based
reciprocity.
}
\details{
For \emph{undirected} networks every present edge is counted as a mutual
dyad and the asymmetric count is always zero, so the census reduces to a
present/absent split. The total number of dyads is \eqn{n(n-1)/2} regardless
of direction.
}
\examples{
# Directed network with a mix of mutual and asymmetric ties
adj <- matrix(c(
  0, 1, 1, 0,
  1, 0, 0, 1,
  0, 0, 0, 1,
  0, 0, 0, 0
), 4, 4, byrow = TRUE)
rownames(adj) <- colnames(adj) <- LETTERS[1:4]
cograph::dyad_census(adj)
}
\references{
Wasserman, S., & Faust, K. (1994). \emph{Social Network Analysis: Methods
and Applications}. Cambridge University Press.
}
\seealso{
\code{\link{triad_census}}, \code{\link{edge_reciprocity}},
\code{\link{network_summary}}
}
