Learn R Programming

cograph (version 2.0.0)

get_edge_list: 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)

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

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.

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

Run this code
if (FALSE) { # requireNamespace("tna", quietly = TRUE)
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)
}

Run the code above in your browser using DataLab