% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/network-utils.R
\name{to_data_frame}
\alias{to_data_frame}
\alias{to_df}
\title{Export Network as Edge List Data Frame}
\usage{
to_data_frame(x, directed = NULL)

to_df(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.}
}
\value{
A data frame with columns:
\itemize{
\item \code{from}: Source node name/label
\item \code{to}: Target node name/label
\item \code{weight}: Edge weight
}
}
\description{
Converts a network to an edge list data frame with columns for source,
target, and weight.
}
\examples{
adj <- matrix(c(0, .5, .8, 0,
                .5, 0, .3, .6,
                .8, .3, 0, .4,
                 0, .6, .4, 0), 4, 4, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C", "D")

# Convert to edge list
to_data_frame(adj)

# Use alias
to_df(adj)
}
\seealso{
\code{\link{to_df}}, \code{\link{to_igraph}}, \code{\link{as_cograph}}
}
