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

Companion tutorials

We have also released comprehensive new tutorials for the main TNA features:

TutorialLink
An Updated Comprehensive Tutorial on Transition Network Analysis (TNA)https://sonsoles.me/posts/tna-tutorial/
TNA Group Analysis: Analysis and Comparison of Groupshttps://sonsoles.me/posts/tna-group/
TNA Clustering: Discovering and Analysis of Clustershttps://sonsoles.me/posts/tna-clustering/
TNA Model Comparison:TNA Model Comparison: A Comprehensive Guide to Network Comparisonhttps://sonsoles.me/posts/tna-compare/
Full reference guide on tna functionshttps://sonsoles.me/tna/tna.html

Vignettes

Check out the tna R package vignettes:

VignetteLink
Getting started with tnahttps://sonsoles.me/tna/articles/tna.html
A showcase of the main tna functionshttps://sonsoles.me/tna/articles/complete_tutorial.html
How to prepare data for tnahttps://sonsoles.me/tna/articles/prepare_data.html
Frequency-based TNAhttps://sonsoles.me/tna/articles/ftna.html
Attention TNAhttps://sonsoles.me/tna/articles/atna.html
Finding cliques and communitieshttps://sonsoles.me/tna/articles/communities_and_cliques.html
Using grouped sequence datahttps://sonsoles.me/tna/articles/grouped_sequences.html

Book chapters

Do not forget to check out our tutorials in the “Advanced learning analytics methods” book:

TitlePagesTutorial
Saqr, M., Lopez-Pernas, S., & Tikka, S. Mapping Relational Dynamics with Transition Network Analysis: A Primer and Tutorialhttps://doi.org/10.1007/978-3-031-95365-1_15Online tutorial
Saqr, M., Lopez-Pernas, S., & Tikka, S. Capturing the Breadth and Dynamics of the Temporal Processes with Frequency Transition Network Analysis: A Primer and Tutorialhttps://doi.org/10.1007/978-3-031-95365-1_16Online tutorial
Lopez-Pernas, S., Tikka, S., & Saqr, M. Mining Patterns and Clusters with Transition Network Analysis: A Heterogeneity Approachhttps://doi.org/10.1007/978-3-031-95365-1_17Online tutorial

Other tools

In addition to the tna R package, you can also try our Shiny app and Jamovi plugin.

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

201

Version

1.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Sonsoles López-Pernas

Last Published

February 12th, 2026

Functions in tna (1.2.0)

plot.group_tna

Plot a Grouped Transition Network Analysis Model
plot.tna_communities

Plot Communities
plot.group_tna_centralities

Plot Centrality Measures
plot.tna_centralities

Plot Centrality Measures
plot.tna_cliques

Plot Cliques of a TNA Network
plot.tna_bootstrap

Plot a Bootstrapped Transition Network Analysis Model
plot.group_tna_permutation

Plot Permutation Test Results
plot.group_tna_communities

Plot Detected Communities
plot.group_tna_cliques

Plot Found Cliques
plot.group_tna_stability

Plot Centrality Stability Results
plot.tna

Plot a Transition Network Analysis Model
plot_compare

Plot the Difference Network Between Two Models
plot_frequencies.group_tna

Plot the Frequency Distribution of States
plot.tna_stability

Plot Centrality Stability Results
plot_compare.group_tna

Plot the Difference Network Between Two Groups
plot.tna_sequence_comparison

Plot a Sequence Comparison
plot.tna_comparison

Plot the Comparison of Two TNA Models or Matrices
plot_associations

Plot an Association Network
plot_frequencies

Plot the Frequency Distribution of States
plot.tna_permutation

Plot the Significant Differences from a Permutation Test
plot.tna_reliability

Plot Reliability Analysis Results
print.group_tna

Print a group_tna Object
plot_model

Plot a Transition Network Model from a Matrix of Edge Weights
plot_sequences

Create a Sequence Index Plot or a Distribution Plot
prepare_data

Compute User Sessions from Event Data
plot_mosaic.group_tna

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

Print group_tna Bootstrap Results
plot_mosaic

Create a Mosaic Plot of Transitions or Events
plot_mosaic.tna_data

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

Print Found Cliques
print.group_tna_centralities

Print Centrality Measures
print.summary.group_tna_bootstrap

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

Print Permutation Test Results
print.summary.tna_bootstrap

Print a Bootstrap Summary
print.group_tna_communities

Print Detected Communities
print.summary.tna

Print a TNA Summary
print.tna

Print a tna Object
print.tna_centralities

Print Centrality Measures
print.tna_bootstrap

Print Bootstrap Results
print.tna_permutation

Print Permutation Test Results
print.tna_sequence_comparison

Print a Comparison of Sequences
print.tna_communities

Print Detected Communities
print.tna_data

Print a TNA Data Object
print.tna_reliability

Print Reliability Analysis Results
print.summary.group_tna

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

Print Comparison Results
print.tna_clustering

Print the Results of Clustering
print.group_tna_stability

Print Centrality Stability Results
print.tna_cliques

Print Found Cliques of a TNA Network
print.tna_stability

Print Centrality Stability Results
prune

Prune a Transition Network based on Transition Probabilities
summary.group_tna

Calculate Summary of Network Metrics for a grouped Transition Network
simulate.tna

Simulate Data from a Transition Network Analysis Model
reexports

Objects exported from other packages
pruning_details

Print Detailed Information on the Pruning Results
reprune

Restore Previous Pruning of a Transition Network Analysis Model
rename_groups

Rename Groups
reliability

Assess Model Reliability
summary.group_tna_bootstrap

Summarize Bootstrap Results for a Grouped Transition Network
simulate.group_tna

Simulate Data from a Group Transition Network Analysis Model
sna

Build a Social Network Analysis Model
summary.tna

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

The tna Package.
summary.tna_bootstrap

Summarize Bootstrap Results
cliques

Identify Cliques in a Transition Network
as.igraph.matrix

Coerce a Weight Matrix into an igraph Object.
as.igraph.tna

Coerce a tna Object into an igraph Object.
bootstrap

Bootstrap Transition Networks from Sequence Data
bootstrap_cliques

Bootstrap Cliques of Transition Networks from Sequence Data
build_model

Build a Transition Network Analysis Model
betweenness_network

Build and Visualize a Network with Edge Betweenness
centralities

Calculate Centrality Measures for a Transition Matrix
as.igraph.group_tna

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

Clustering via Dissimilarity Matrix based on String Distances
deprune

Restore a Pruned Transition Network Analysis Model
compare.group_tna

Compare Grouped TNA Models with Comprehensive Metrics
engagement_mmm

Example Mixed Markov Model Fitted to the engagement Data
estimate_cs

Estimate Centrality Stability
communities

Community Detection for Transition Networks
compare

Compare Two Matrices or TNA Models with Comprehensive Metrics
engagement

Example Data on Student Engagement
group_regulation

Example Wide Data on Group Regulation
group_model

Build a Grouped Transition Network Analysis Model
compare_sequences

Compare Sequences Between Groups
hist.group_tna

Plot a Histogram of Edge Weights for a group_tna Object.
plot.group_tna_bootstrap

Plot a Bootstrapped Grouped Transition Network Analysis Model
import_data

Import Wide Format Sequence Data as Long Format Sequence Data
group_regulation_long

Example Long Data on Group Regulation
hist.tna

Plot a Histogram of Edge Weights in the Network
import_onehot

Import One-Hot Data
permutation_test

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

Compare Networks using a Permutation Test
mmm_stats

Retrieve Statistics from a Mixture Markov Model (MMM)