% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_netobject.R
\name{validate_netobject}
\alias{validate_netobject}
\title{Validate a netobject / cograph_network against the shared schema}
\usage{
validate_netobject(x)
}
\arguments{
\item{x}{An object expected to satisfy the \code{cograph_network} contract.}
}
\value{
Invisibly \code{TRUE} if \code{x} conforms; otherwise stops with the
full list of violations.
}
\description{
Enforces the structural contract that both Nestimate netobjects and
\pkg{psychnet} objects must satisfy to be interchangeable across the package
boundary. This is the single place that says what "a network object" means,
so a drift on either side (a renamed field, a mistyped edge column) fails
loudly here rather than mis-rendering three layers downstream.
}
\details{
The contract is deliberately the \emph{shared} subset: the \code{$nodes}
\code{x}/\code{y} layout columns and the Nestimate pipeline fields
(\code{$data}, \code{$level}, ...) are not required, and \code{$edges}
endpoints may be either integer node indices (Nestimate) or character labels
(psychnet).
}
\examples{
net <- build_cor(data.frame(a = rnorm(50), b = rnorm(50), c = rnorm(50)))
validate_netobject(net)
}
\seealso{
\code{\link{as_netobject}}
}
