Extract individual-level transition counts as an edge list from a tna object.
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)
#> id from to count
#> 1 1 synthesis adapt 1
#> 2 1 adapt consensus 1
#> 3 1 cohesion consensus 1
#> 4 1 plan consensus 1
#> 5 1 consensus discuss 1
#> 6 1 consensus plan 1
# Aggregate across individuals
agg_edges <- get_edge_list(Mod, by_individual = FALSE)
