% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extraction.R
\name{extract_edges}
\alias{extract_edges}
\title{Extract Edge List with Weights}
\usage{
extract_edges(model, threshold = 0, include_self = FALSE, sort_by = "weight")
}
\arguments{
\item{model}{A TNA model object or a matrix of weights.}

\item{threshold}{Numeric. Minimum weight to include an edge. Default: 0.}

\item{include_self}{Logical. Whether to include self-loops. Default: FALSE.}

\item{sort_by}{Character. Column to sort by: "weight" (descending),
"from", "to", or NULL for no sorting. Default: "weight".}
}
\value{
A data frame with columns:
\describe{
\item{from}{Source state name.}
\item{to}{Target state name.}
\item{weight}{Edge weight (transition probability).}
}
}
\description{
Extract an edge list from a TNA model, representing the network as a
data frame of from-to-weight tuples.
}
\details{
This function converts the transition matrix into an edge list format,
which is useful for visualization, analysis with igraph, or export to
other network tools.
}
\examples{
seqs <- data.frame(V1 = c("A","B","A"), V2 = c("B","A","C"), V3 = c("A","C","B"))
net <- build_network(seqs, method = "relative")
edges <- extract_edges(net, threshold = 0.05)
head(edges)

}
\seealso{
\code{\link{extract_transition_matrix}} for the full matrix,
\code{\link{build_network}} for network estimation.
}
