Learn R Programming

tna: An R package for Transition Network Analysis

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., 2024) for more details on TNA. Also, check out our tutorials on the basics of TNA, frequency-based TNA, and clustering with TNA.

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 library

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

178

Version

0.4.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Sonsoles López-Pernas

Last Published

March 1st, 2025

Functions in tna (0.4.0)

group_model

Build a grouped Transition Network Analysis Model
hist.tna

Plot a Histogram of Edge Weights in the Network
engagement

Example data on student engagement
deprune

Restore a Pruned Transition Network Analysis Model
compare.group_tna

Compare TNA Clusters with Comprehensive Metrics
hist.group_tna

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

Estimate Centrality Stability
group_regulation

Example data on group regulation
engagement_mmm

Example mixed Markov model fitted to the engagement data
mmm_stats

Retrieve statistics from a mixture Markov model (MMM)
plot.group_tna_cliques

Plot Found Cliques
plot.tna_cliques

Plot Cliques of a TNA Network
plot.group_tna_centralities

Plot Centrality Measures
plot.tna_centralities

Plot Centrality Measures
plot_compare

Plot the difference network between two models
plot.group_tna_communities

Plot Found Communities
plot.tna

Plot a Transition Network Analysis Model
permutation_test

Compare Two Networks from Sequence Data Using Permutation Tests
plot.tna_comparison

Plot the results of comparing two tna models or matrices
plot.group_tna_stability

Plot Centrality Stability Results
plot.group_tna

Plot a grouped Transition Network Analysis Model
plot.tna_stability

Plot Centrality Stability Results
print.summary.tna_bootstrap

Print Bootstrap Summary
plot.tna_communities

Plot Communities
plot_mosaic.group_tna

Plot state frequencies as a mosaic between two groups
plot_compare.group_tna

Plot the difference network between two clusters
plot_model

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

Create a mosaic plot of transitions
print.summary.tna

Print a TNA Summary
print.group_tna_cliques

Print Found Cliques
prepare_data

Compute User Sessions from Event Data
print.group_tna_centralities

Print Centrality Measures
print.tna_communities

Print Detected Communities
print.tna_stability

Print Centrality Stability Results
plot_mosaic.tna_data

Plot state frequencies as a mosaic between two groups
print.tna_centralities

Print Centrality Measures
print.tna_comparison

Print Comparison Results
summary.tna

Calculate Summary of Network Metrics for a Transition Network
prune

Prune a tna network based on transition probabilities
summary.tna_bootstrap

Summarize Bootstrap Results
tna-package

The tna package.
plot.tna_permutation

Plot the Significant Differences from a Permutation Test
print.group_tna_bootstrap

Print group_tna Bootstrap Results
print.group_tna

Print a group_tna Object
print.tna_cliques

Print Found Cliques of a TNA Network
summary.group_tna

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

Summarize Bootstrap Results for a Grouped Transition Network
print.tna_permutation

Print Permutation Test Results
print.summary.group_tna

Print the summary of a grouped Transition Network Analysis Model
print.summary.group_tna_bootstrap

Print Bootstrap Summary for a Grouped Transition Network
print.tna_data

Print a TNA data object
print.tna

Print a tna object
print.group_tna_stability

Print Centrality Stability Results
print.tna_bootstrap

Print Bootstrap Results
print.group_tna_communities

Print Detected Communities
pruning_details

Print Detailed Information on the Pruning Results
reprune

Restore Previous Pruning of a Transition Network Analysis Model
rename_groups

Rename clusters
reexports

Objects exported from other packages
betweenness_network

Build and Visualize a Network with Edge Betweenness
bootstrap

Bootstrap Transition Networks from Sequence Data
build_model

Build a Transition Network Analysis Model
as.igraph.group_tna

Coerce a specific group from a group_tna object to an igraph object.
cliques

Identify Cliques in a Transition Network
as.igraph.matrix

Coerce a weight matrix to an igraph object.
centralities

Calculate Centrality Measures for a Transition Matrix
compare

Compare Two Matrices or TNA Models with Comprehensive Metrics
communities

Community Detection for Transition Networks
as.igraph.tna

Coerce a tna object to an igraph object.