validate_netobject: Validate a netobject / cograph_network against the shared...

View source: R/as_netobject.R

validate_netobjectR Documentation

Validate a netobject / cograph_network against the shared schema

Description

Enforces the structural contract that both Nestimate netobjects and 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.

Usage

validate_netobject(x)

Arguments

x

An object expected to satisfy the cograph_network contract.

Details

The contract is deliberately the shared subset: the $nodes x/y layout columns and the Nestimate pipeline fields ($data, $level, ...) are not required, and $edges endpoints may be either integer node indices (Nestimate) or character labels (psychnet).

Value

Invisibly TRUE if x conforms; otherwise stops with the full list of violations.

See Also

as_netobject

Examples

net <- build_cor(data.frame(a = rnorm(50), b = rnorm(50), c = rnorm(50)))
validate_netobject(net)

Nestimate documentation built on July 11, 2026, 1:09 a.m.