{"id":25257835,"url":"https://github.com/sonsoleslp/tna","last_synced_at":"2025-09-05T11:22:25.831Z","repository":{"id":241109178,"uuid":"802982410","full_name":"sonsoleslp/tna","owner":"sonsoleslp","description":"Transition Network Analysis R package","archived":false,"fork":false,"pushed_at":"2025-08-18T08:42:51.000Z","size":185570,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-18T10:25:51.781Z","etag":null,"topics":["cran-r","educational-data-mining","learning-analytics","markov-model","r","temporal-analysis"],"latest_commit_sha":null,"homepage":"http://sonsoles.me/tna/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sonsoleslp.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-19T19:28:33.000Z","updated_at":"2025-08-15T12:51:34.000Z","dependencies_parsed_at":"2024-06-10T08:32:15.375Z","dependency_job_id":"dd1090cd-f095-4402-b2a5-b371a7242d6d","html_url":"https://github.com/sonsoleslp/tna","commit_stats":null,"previous_names":["sonsoleslp/tna"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sonsoleslp/tna","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonsoleslp%2Ftna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonsoleslp%2Ftna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonsoleslp%2Ftna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonsoleslp%2Ftna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonsoleslp","download_url":"https://codeload.github.com/sonsoleslp/tna/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonsoleslp%2Ftna/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273748952,"owners_count":25160946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cran-r","educational-data-mining","learning-analytics","markov-model","r","temporal-analysis"],"created_at":"2025-02-12T06:50:40.639Z","updated_at":"2025-09-05T11:22:25.824Z","avatar_url":"https://github.com/sonsoleslp.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"60%\",\n  fig.width = 5,\n  fig.height = 5,\n  fig.align = \"center\",\n  dev = \"svg\",\n  fig.ext = \"svg\",\n  out.extra = \"style='text-align: center; display: block; margin: auto;'\"\n)\n```\n\n\n# `tna`: An R package for Transition Network Analysis \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"139\"/\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![R-CMD-check](https://github.com/sonsoleslp/tna/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/sonsoleslp/tna/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/sonsoleslp/tna/graph/badge.svg)](https://app.codecov.io/gh/sonsoleslp/tna)\n[![tna CRAN badge](https://www.r-pkg.org/badges/version/tna)](https://cran.r-project.org/package=tna)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\u003c!-- badges: end --\u003e\n\n`tna` is an R package for the analysis of relational dynamics through \nTransition Network Analysis (TNA). TNA provides tools for building TNA models, \nplotting transition networks, calculating centrality measures, and identifying \ndominant events and patterns. TNA statistical techniques (e.g., bootstrapping \nand permutation tests) ensure the reliability of observed insights and confirm\nthat identified dynamics are meaningful. See [(Saqr et al., 2025)](https://doi.org/10.1145/3706468.3706513) for more details on TNA.\n\n\n![](man/figures/method.png)\n\n\n## Resources\n\nCheck out our tutorials:\n\n - [Basics of TNA](https://lamethods.org/book2/chapters/ch15-tna/ch15-tna.html)\n - [Frequency-based TNA](https://lamethods.org/book2/chapters/ch16-ftna/ch16-ftna.html)\n - [Clustering](https://lamethods.org/book2/chapters/ch17-tna-clusters/ch17-tna-clusters.html)\n \nYou can also try our [Shiny app](https://sonsoleslp.shinyapps.io/tna-app/).\n\n## Installation\n\nYou can install the most recent stable version of `tna` from [CRAN](https://cran.r-project.org/package=tna) or the development version from [GitHub](https://github.com/) by running one of the following:\n\n```{r, eval = FALSE}\ninstall.packages(\"tna\")\n\n# install.packages(\"devtools\")\n# devtools::install_github(\"sonsoleslp/tna\")\n```\n\n## Example\n\nLoad the package\n```{r, echo=FALSE}\nsuppressPackageStartupMessages(library(\"tna\"))\n```\n```{r, eval=FALSE}\nlibrary(\"tna\")\n```\n\nExample data\n```{r}\ndata(\"group_regulation\", package = \"tna\")\n```\n\nBuild a Markov model\n```{r}\ntna_model \u003c- tna(group_regulation)\n```\n\n```{r, eval=FALSE}\nsummary(tna_model)\n```\n```{r, echo=FALSE}\nsummary(tna_model) |\u003e\n  gt::gt() |\u003e\n  gt::fmt_number(decimals = 2) |\u003e\n  gt::as_raw_html()\n```\n\nPlot the transition network\n```{r tnaplot}\n# Default plot\nplot(tna_model) \n# Optimized plot\nplot(\n  tna_model, cut = 0.2, minimum = 0.05, \n  edge.label.position = 0.8, edge.label.cex = 0.7\n)\n```\nCalculate the centrality measures\n```{r}\ncent \u003c- centralities(tna_model)\n```\n\n```{r, echo=FALSE}\ncent |\u003e\n  gt::gt() |\u003e\n  gt::tab_options(table.font.size = 8) |\u003e\n  gt::fmt_number(decimals = 3) |\u003e\n  gt::as_raw_html()\n```\n\nPlot the centrality measures\n\n```{r centralitiesplot, fig.width=12, fig.height=8, out.width=\"90%\"}\nplot(cent, ncol = 3)\n```\n\nEstimate centrality stability\n```{r}\nestimate_centrality_stability(tna_model)\n```\n\nIdentify and plot communities\n```{r}\ncoms \u003c- communities(tna_model)\nplot(coms)\n```\n\nFind and plot cliques\n```{r, eval = F}\ncqs \u003c- cliques(tna_model, threshold = 0.12)\nplot(cqs)\n```\n\n```{r, out.width=\"100%\", fig.width=6, fig.height=2, echo = FALSE}\nlayout(t(1:3))\ncqs \u003c- cliques(tna_model, threshold = 0.12)\nplot(cqs, vsize = 30, edge.label.cex = 3)\n```\n\nCompare high achievers (first 1000) with low achievers (last 1000)\n```{r}\ntna_model_start_high \u003c- tna(group_regulation[1:1000, ])\ntna_model_start_low \u003c- tna(group_regulation[1001:2000, ])\ncomparison \u003c- permutation_test(\n  tna_model_start_high, \n  tna_model_start_low,\n  measures = c(\"InStrength\")\n)\n```\n\nSimple comparison vs. permutation test comparison\n```{r, fig.width=10, fig.height=5, out.width=\"100%\", echo = 2:3}\nlayout(t(1:2))\nplot_compare(tna_model_start_high, tna_model_start_low)\nplot(comparison)\n```\n\nCompare centralities\n```{r, eval = FALSE}\nprint(comparison$centralities$stats)\n```\n\n```{r, echo = FALSE}\ncomparison$centralities$stats |\u003e\n  gt::gt() |\u003e\n  gt::as_raw_html()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonsoleslp%2Ftna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonsoleslp%2Ftna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonsoleslp%2Ftna/lists"}