Learn R Programming

tna: An R package for Transition Network Analysis

tna is an R package for the analysis of relational dynamics through Transition Network Analysis (TNA). TNA provides tools for building TNA models, plotting transition networks, calculating centrality measures, and identifying dominant events and patterns. TNA statistical techniques (e.g., bootstrapping and permutation tests) ensure the reliability of observed insights and confirm that identified dynamics are meaningful. See (Saqr et al., 2025) for more details on TNA.

Resources

Check out our tutorials:

You can also try our Shiny app.

Installation

You can install the most recent stable version of tna from CRAN or the development version from GitHub by running one of the following:

install.packages("tna")

# install.packages("devtools")
# devtools::install_github("sonsoleslp/tna")

Example

Load the package

library("tna")

Example data

data("group_regulation", package = "tna")

Build a Markov model

tna_model <- tna(group_regulation)
summary(tna_model)

Plot the transition network

# Default plot
plot(tna_model) 
# Optimized plot
plot(
  tna_model, cut = 0.2, minimum = 0.05, 
  edge.label.position = 0.8, edge.label.cex = 0.7
)
cent <- centralities(tna_model)

Copy Link

Version

Install

install.packages('tna')

Monthly Downloads

229

Version

1.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Sonsoles López-Pernas

Last Published

October 18th, 2025

Functions in tna (1.1.0)

communities

Community Detection for Transition Networks
compare

Compare Two Matrices or TNA Models with Comprehensive Metrics
import_data

Import Wide Format Sequence Data as Long Format Sequence Data
plot.group_tna

Plot a Grouped Transition Network Analysis Model
mmm_stats

Retrieve Statistics from a Mixture Markov Model (MMM)
permutation_test.group_tna

Compare Networks using a Permutation Test
plot.group_tna_bootstrap

Plot a Bootstrapped Grouped Transition Network Analysis Model
import_onehot

Import One-Hot Data and Create a Co-Occurrence Network Model
permutation_test

Compare Two Networks from Sequence Data using a Permutation Test
hist.group_tna

Plot a Histogram of Edge Weights for a group_tna Object.
group_regulation_long

Example Long Data on Group Regulation
hist.tna

Plot a Histogram of Edge Weights in the Network
plot.group_tna_centralities

Plot Centrality Measures
plot.group_tna_communities

Plot Detected Communities
plot.group_tna_stability

Plot Centrality Stability Results
plot.tna_centralities

Plot Centrality Measures
plot.group_tna_cliques

Plot Found Cliques
plot.tna_bootstrap

Plot a Bootstrapped Transition Network Analysis Model
plot.tna_cliques

Plot Cliques of a TNA Network
plot.group_tna_permutation

Plot Permutation Test Results
plot.tna_communities

Plot Communities
plot_associations

Plot an Association Network
plot.tna_permutation

Plot the Significant Differences from a Permutation Test
plot.tna

Plot a Transition Network Analysis Model
plot_model

Plot a Transition Network Model from a Matrix of Edge Weights
plot.tna_stability

Plot Centrality Stability Results
plot_compare.group_tna

Plot the Difference Network Between Two Groups
plot_frequencies

Plot the Frequency Distribution of States
plot_frequencies.group_tna

Plot the Frequency Distribution of States
plot.tna_comparison

Plot the Comparison of Two TNA Models or Matrices
plot_compare

Plot the Difference Network Between Two Models
plot.tna_sequence_comparison

Plot a Sequence Comparison
print.group_tna_centralities

Print Centrality Measures
plot_mosaic

Create a Mosaic Plot of Transitions or Events
plot_mosaic.group_tna

Plot State Frequencies as a Mosaic Between Two Groups
print.group_tna_communities

Print Detected Communities
print.group_tna_cliques

Print Found Cliques
prepare_data

Compute User Sessions from Event Data
plot_mosaic.tna_data

Plot State Frequencies as a Mosaic Between Two Groups
print.group_tna

Print a group_tna Object
plot_sequences

Create a Sequence Index Plot or a Distribution Plot
print.group_tna_bootstrap

Print group_tna Bootstrap Results
print.group_tna_permutation

Print Permutation Test Results
print.summary.group_tna_bootstrap

Print a Bootstrap Summary for a Grouped Transition Network Model
print.tna_bootstrap

Print Bootstrap Results
print.summary.tna

Print a TNA Summary
print.summary.group_tna

Print a Summary of a Grouped Transition Network Analysis Model
print.tna_cliques

Print Found Cliques of a TNA Network
print.tna

Print a tna Object
print.group_tna_stability

Print Centrality Stability Results
print.summary.tna_bootstrap

Print a Bootstrap Summary
print.tna_centralities

Print Centrality Measures
print.tna_communities

Print Detected Communities
print.tna_permutation

Print Permutation Test Results
rename_groups

Rename Groups
print.tna_comparison

Print Comparison Results
reexports

Objects exported from other packages
print.tna_stability

Print Centrality Stability Results
print.tna_sequence_comparison

Print a Comparison of Sequences
pruning_details

Print Detailed Information on the Pruning Results
prune

Prune a Transition Network based on Transition Probabilities
print.tna_data

Print a TNA Data Object
simulate.tna

Simulate Data from a Transition Network Analysis Model
summary.group_tna

Calculate Summary of Network Metrics for a grouped Transition Network
tna-package

The tna Package.
summary.tna_bootstrap

Summarize Bootstrap Results
reprune

Restore Previous Pruning of a Transition Network Analysis Model
sna

Build a Social Network Analysis Model
summary.tna

Calculate Summary of Network Metrics for a Transition Network
summary.group_tna_bootstrap

Summarize Bootstrap Results for a Grouped Transition Network
cluster_sequences

Cluster Sequences via Dissimilarity Matrix based on String Distances
betweenness_network

Build and Visualize a Network with Edge Betweenness
bootstrap

Bootstrap Transition Networks from Sequence Data
as.igraph.group_tna

Coerce a Specific Group from a group_tna Object into an igraph Object.
cliques

Identify Cliques in a Transition Network
as.igraph.tna

Coerce a tna Object into an igraph Object.
bootstrap_cliques

Bootstrap Cliques of Transition Networks from Sequence Data
as.igraph.matrix

Coerce a Weight Matrix into an igraph Object.
centralities

Calculate Centrality Measures for a Transition Matrix
build_model

Build a Transition Network Analysis Model
group_regulation

Example Wide Data on Group Regulation
compare_sequences

Compare Sequences Between Groups
group_model

Build a Grouped Transition Network Analysis Model
deprune

Restore a Pruned Transition Network Analysis Model
compare.group_tna

Compare Grouped TNA Models with Comprehensive Metrics
engagement

Example Data on Student Engagement
engagement_mmm

Example Mixed Markov Model Fitted to the engagement Data
estimate_cs

Estimate Centrality Stability