get_edge_list: Extract Raw Edge List from TNA Model

View source: R/motifs.R

get_edge_listR Documentation

Extract Raw Edge List from TNA Model

Description

Extract individual-level transition counts as an edge list from a tna object.

Usage

get_edge_list(x, by_individual = TRUE, drop_zeros = TRUE)

Arguments

x

A tna object created by tna::tna()

by_individual

Logical. If TRUE (default), returns edge list with individual IDs. If FALSE, aggregates across all individuals.

drop_zeros

Logical. If TRUE (default), excludes edges with zero count.

Value

A data frame with columns:

id

Individual identifier (only if by_individual = TRUE)

from

Source state label

to

Target state label

count

Number of transitions

See Also

extract_motifs() for motif analysis using edge lists

Other motifs: extract_motifs(), extract_triads(), motif_census(), motifs(), plot.cograph_motif_analysis(), plot.cograph_motifs(), subgraphs(), triad_census()

Examples


Mod <- tna::tna(tna::group_regulation)

# Get edge list by individual
edges <- get_edge_list(Mod)
head(edges)

# Aggregate across individuals
agg_edges <- get_edge_list(Mod, by_individual = FALSE)


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