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 Data Preparation: A Comprehensive Guide to prepare_data()https://sonsoles.me/posts/tna-data/
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
Sequence Patterns, Outcomes, and Indices with codynahttps://sonsoles.me/posts/codyna-seq-tutorial/

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

plot(tna_model) 
#> Registered S3 method overwritten by 'cograph':
#>   method             from
#>   plot.tna_bootstrap tna
cent <- centralities(tna_model)

Copy Link

Version

Install

install.packages('tna')

Monthly Downloads

1,073

Version

1.5.8

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Sonsoles López-Pernas

Last Published

November 16th, 2026

Functions in tna (1.5.8)

permutation_test

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

Compare Networks using a Permutation Test
plot.group_tna_bootstrap

Plot a Bootstrapped Grouped Transition Network Analysis Model
list_random_state_pools

List Built-in Label Pools for random_tna()
plot.group_tna_communities

Plot Detected Communities
plot.group_tna

Plot a Grouped Transition Network Analysis Model
plot.group_tna_permutation

Plot Permutation Test Results
import_onehot

Import One-Hot Data
group_regulation_long

Example Long Data on Group Regulation
hist.group_tna

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

Plot a Sequence Comparison
plot_associations

Plot an Association Network
import_data

Import Wide Format Sequence Data as Long Format Sequence Data
hist.tna

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

Plot the Comparison of Two TNA Models or Matrices
plot.group_tna_stability

Plot Centrality Stability Results
plot.tna

Plot a Transition Network Analysis Model
plot.tna_stability

Plot Centrality Stability Results
plot.tna_markov_order

Plot the Results of a Markov Order Test
plot_compare

Plot the Difference Network Between Two Models
group_regulation

Example Wide Data on Group Regulation
plot.tna_reliability

Plot Reliability Analysis Results
plot.tna_permutation

Plot the Significant Differences from a Permutation Test
plot_mosaic

Create a Mosaic Plot of Transitions or Events
plot.tna_bootstrap

Plot a Bootstrapped Transition Network Analysis Model
print.group_tna_communities

Print Detected Communities
plot_compare.group_tna

Plot the Difference Network Between Two Groups
plot_frequencies

Plot the Frequency Distribution of States
print.group_tna_cliques

Print Found Cliques
plot.tna_centralities

Plot Centrality Measures
plot.tna_cliques

Plot Cliques of a TNA Network
print.tna_bootstrap

Print Bootstrap Results
print.tna_centralities

Print Centrality Measures
print.group_tna_permutation

Print Permutation Test Results
print.group_tna_stability

Print Centrality Stability Results
print.summary.tna

Print a TNA Summary
print.summary.tna_bootstrap

Print a Bootstrap Summary
plot_mosaic.group_tna

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

Print Comparison Results
print.tna_communities

Print Detected Communities
prepare_data

Compute User Sessions from Event Data
print.group_tna

Print a group_tna Object
pruning_details

Print Detailed Information on the Pruning Results
print.summary.tna_markov_order

Print a Summary of a Markov Order Test
print.summary.group_tna

Print a Summary of a Grouped Transition Network Analysis Model
print.summary.group_tna_bootstrap

Print a Bootstrap Summary for a Grouped Transition Network Model
plot.group_tna_centralities

Plot Centrality Measures
markov_order

Test the Markov Order of Sequence Data
mmm_stats

Retrieve Statistics from a Mixture Markov Model (MMM)
print.tna

Print a tna Object
prune

Prune a Transition Network based on Transition Probabilities
plot.group_tna_cliques

Plot Found Cliques
plot.tna_communities

Plot Communities
print.tna_data

Print a TNA Data Object
plot_frequencies.group_tna

Plot the Frequency Distribution of States
plot_model

Plot a Transition Network Model from a Matrix of Edge Weights
print.tna_markov_order

Print the Results of a Markov Order Test
summary.group_tna_bootstrap

Summarize Bootstrap Results for a Grouped Transition Network
random_tna_mmm

Build a Random Mixture Markov Model Object
reexports

Objects exported from other packages
random_tna

Build a Random Transition Network Analysis Model
rename_groups

Rename Groups
reliability

Assess Model Reliability
random_group_tna

Build a Random Group Transition Network Analysis Model
print.group_tna_bootstrap

Print group_tna Bootstrap Results
plot_sequences

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

Print Centrality Measures
print.tna_cliques

Print Found Cliques of a TNA Network
plot_mosaic.tna_data

Plot State Frequencies as a Mosaic Between Two Groups
tna-package

The tna Package.
print.tna_permutation

Print Permutation Test Results
summary.tna_stability

Summarize Case-Dropping Stability Results
print.tna_reliability

Print Reliability Analysis Results
reprune

Restore Previous Pruning of a Transition Network Analysis Model
simulate

summary.tna_bootstrap

Summarize Bootstrap Results
sna

Build a Social Network Analysis Model
summary.group_tna

Calculate Summary of Network Metrics for a grouped Transition Network
print.tna_clustering

Print the Results of Clustering
print.tna_sequence_comparison

Print a Comparison of Sequences
print.tna_stability

Print Centrality Stability Results
simulate.group_tna

Simulate Data from a Group Transition Network Analysis Model
simulate.tna

Simulate Data from a Transition Network Analysis Model
summary.tna_reliability

Summarize Split-Half Reliability Results
summary.tna_permutation

Summarize Permutation Test Results
summary.tna

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

Summarize a Markov Order Test
as.igraph.tna

Coerce a tna Object into an igraph Object.
as.igraph.group_tna

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

Calculate Centrality Measures for a Transition Matrix
bootstrap

Bootstrap Transition Networks from Sequence Data
betweenness_network

Build and Visualize a Network with Edge Betweenness
cluster_data

Clustering via Dissimilarity Matrix based on String Distances
cliques

Identify Cliques in a Transition Network
bootstrap_cliques

Bootstrap Cliques of Transition Networks from Sequence Data
build_model

Build a Transition Network Analysis Model
as.igraph.matrix

Coerce a Weight Matrix into an igraph Object.
communities

Community Detection for Transition Networks
compare_sequences

Compare Sequences Between Groups
compare.group_tna

Compare Grouped TNA Models with Comprehensive Metrics
compare

Compare Two Matrices or TNA Models with Comprehensive Metrics
engagement_mmm

Example Mixture Markov Model Object for the engagement Data
group_model

Build a Grouped Transition Network Analysis Model
deprune

Restore a Pruned Transition Network Analysis Model
engagement

Example Data on Student Engagement
estimate_cs

Estimate Centrality Stability