% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/network-utils.R
\name{to_network}
\alias{to_network}
\title{Convert Network to statnet network Object}
\usage{
to_network(x, directed = NULL)
}
\arguments{
\item{x}{Network input: matrix, cograph_network, igraph, tna, etc.}

\item{directed}{Logical or NULL. If NULL (default), auto-detect from input.}
}
\value{
A network object from the network package.
}
\description{
Converts any supported network format to a statnet network object.
}
\examples{
if (requireNamespace("network", quietly = TRUE)) {
  adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), 3, 3)
  rownames(adj) <- colnames(adj) <- c("A", "B", "C")
  net <- to_network(adj)
}
}
\seealso{
\code{\link{to_igraph}}, \code{\link{to_matrix}}, \code{\link{to_df}},
\code{\link{as_cograph}}
}
