% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/centrality_measures.R
\name{net_centrality}
\alias{net_centrality}
\title{Compute Centrality Measures for a Network}
\usage{
net_centrality(
  x,
  measures = NULL,
  loops = FALSE,
  normalize = FALSE,
  invert = TRUE,
  normalize_diffusion = TRUE,
  centrality_fn = NULL,
  ...
)
}
\arguments{
\item{x}{A \code{netobject}, \code{netobject_group}, or
\code{cograph_network}.}

\item{measures}{Character vector. Centrality measures to compute.
Defaults to \code{c("InStrength", "Betweenness", "Diffusion")}. Pass
\code{"all"} for every built-in measure: \code{"OutStrength"},
\code{"InStrength"}, \code{"ClosenessIn"}, \code{"ClosenessOut"},
\code{"Closeness"}, \code{"Betweenness"}, \code{"BetweennessRSP"},
\code{"Diffusion"}, and \code{"Clustering"}. The legacy aliases
\code{"InCloseness"} and \code{"OutCloseness"} are also accepted.}

\item{loops}{Logical. Include self-loops (diagonal) in computation?
Default: \code{FALSE}.}

\item{normalize}{Logical. Range-normalize all requested measures using the
same transformation as \code{tna::centralities(normalize = TRUE)}.
Default: \code{FALSE}.}

\item{invert}{Logical. Invert weights for shortest-path measures?
Default: \code{TRUE}, matching \code{tna}.}

\item{normalize_diffusion}{Logical. Range-normalize \code{Diffusion} even
when \code{normalize = FALSE}. Default: \code{TRUE}.}

\item{centrality_fn}{Optional function. Custom centrality function that
takes a weight matrix and returns a named list of centrality vectors.}

\item{...}{Additional arguments (ignored).}
}
\value{
For a \code{netobject}: a \code{net_centrality} data frame with
node names as rows, a \code{state} column, and one column per centrality
measure. For a \code{netobject_group}: a \code{net_centrality_group}
list of such data frames.
}
\description{
Computes centrality measures from a \code{netobject},
\code{netobject_group}, \code{mcml}, or \code{cograph_network}. The built-in
measures match \code{tna::centralities()} without importing \code{tna} or
\code{igraph}. The only intentional default difference is that
\code{Diffusion} is range-normalized by default.
}
\examples{
seqs <- data.frame(
  V1 = c("A","B","A","C"), V2 = c("B","C","B","A"),
  V3 = c("C","A","C","B"))
net <- build_network(seqs, method = "relative")
net_centrality(net)

}
