% 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, centrality_fn = NULL, ...)
}
\arguments{
\item{x}{A \code{netobject}, \code{netobject_group}, or
\code{cograph_network}.}

\item{measures}{Character vector. Centrality measures to compute.
Built-in: \code{"InStrength"}, \code{"OutStrength"},
\code{"Betweenness"}, \code{"InCloseness"}, \code{"OutCloseness"},
\code{"Closeness"}. Default depends on directedness.}

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

\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 data frame with node names as rows and
centrality measures as columns. For a \code{netobject_group}: a named
list of such data frames (one per group).
}
\description{
Computes centrality measures from a \code{netobject},
\code{netobject_group}, or \code{cograph_network}. For directed networks
the default measures are InStrength, OutStrength, and Betweenness. For
undirected networks the defaults are Closeness and Betweenness.
}
\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)

}
