% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_netobject.R
\name{as_netobject}
\alias{as_netobject}
\alias{as_netobject.netobject}
\alias{as_netobject.psychnet}
\alias{as_netobject.cograph_network}
\alias{as_netobject.default}
\title{Coerce a network object to a Nestimate netobject}
\usage{
as_netobject(x)

\method{as_netobject}{netobject}(x)

\method{as_netobject}{psychnet}(x)

\method{as_netobject}{cograph_network}(x)

\method{as_netobject}{default}(x)
}
\arguments{
\item{x}{A \code{psychnet} object, a \code{cograph_network}, or a
\code{netobject}.}
}
\value{
A \code{c("netobject", "cograph_network")} object.
}
\description{
Promotes a \pkg{psychnet} result (class \code{c("psychnet",
"cograph_network")}) or any bare \code{cograph_network} to the dual-class
\code{c("netobject", "cograph_network")} used throughout Nestimate, so it
dispatches to the package's verbs (\code{centrality()}, \code{plot()},
bootstrap, reliability, ...). A \code{netobject} is returned unchanged.
}
\details{
The psychnet method re-derives the integer-indexed edge table that Nestimate
expects (psychnet stores character-labelled edges), preserves the estimator
name in \code{$method}, and parks every psychnet-specific field - including
the graphical-lasso \code{$kkt} optimality certificate - under
\code{$meta$psychnet} so nothing is lost in translation.
}
\examples{
net <- build_cor(data.frame(a = rnorm(50), b = rnorm(50), c = rnorm(50)))
identical(as_netobject(net), net) # netobjects pass through unchanged
}
\seealso{
\code{\link{validate_netobject}}
}
