is_directed: Check if Network is Directed

View source: R/class-network.R

is_directedR Documentation

Check if Network is Directed

Description

Checks whether a cograph_network is directed.

Usage

is_directed(x)

Arguments

x

A cograph_network object.

Value

Logical: TRUE if directed, FALSE if undirected.

See Also

as_cograph

Examples

# Symmetric matrix -> undirected
mat <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)
net <- as_cograph(mat)
cograph::is_directed(net)  # FALSE

# Asymmetric matrix -> directed
mat2 <- matrix(c(0, 1, 0, 0, 0, 1, 0, 0, 0), nrow = 3)
net2 <- as_cograph(mat2)
cograph::is_directed(net2)  # TRUE

cograph documentation built on April 1, 2026, 1:07 a.m.