Text Mining and Topic Modeling for Sport Science Literature
Overview
A comprehensive toolkit for mining, analyzing, and visualizing scientific literature in sport science domains. Provides functions for retrieving abstracts from 'Scopus', preprocessing text data, performing advanced topic modeling using Latent Dirichlet Allocation ('LDA'), Structural Topic Models ('STM'), and Correlated Topic Models ('CTM'), and creating publication-ready visualizations including keyword co-occurrence networks and topic trends. For methodological details see Blei et al. (2003) doi:10.1162/jmlr.2003.3.4-5.993 for 'LDA', Roberts et al. (2014) doi:10.1111/ajps.12103 for 'STM', and Blei and Lafferty (2007) doi:10.1214/07-AOAS114 for 'CTM'.
Initial CRAN Release
New Features
- **API Functions**
sm_set_api_key(): Secure API key management via environment variablessm_search_scopus(): Retrieve papers from Scopus with automatic paginationsm_get_indexed_keywords(): Extract indexed keywords for individual papers- **Text Processing**
sm_preprocess_text(): Tokenize, remove stopwords, and stem abstractssm_create_dtm(): Generate document-term matrices with flexible filtering- **Topic Modeling**
sm_select_optimal_k(): Coherence-based selection of topic countsm_train_lda(): Train Latent Dirichlet Allocation models
Show all changes in 0.1.0Hide the rest of the changes in 0.1.0
sm_compare_models(): Multi-model comparison (LDA, STM, CTM) with metrics- **Visualizations**
sm_plot_topic_terms(): Bar charts of top terms per topicsm_plot_topic_frequency(): Document distribution across topicssm_plot_topic_trends(): Stacked percentage charts showing temporal trendstheme_sportminer(): Custom colorblind-friendly ggplot2 theme- **Network Analysis**
sm_keyword_network(): Co-occurrence network visualization
CRAN Compliance
- All API calls wrapped in
tryCatch()for graceful error handling - Global variables properly declared using
.datapronoun from rlang - Message/warning functions used instead of
cat()orprint() - Comprehensive test suite with offline-safe mocks via httptest
- Zero errors, warnings, or notes in
R CMD check --as-cran
Documentation
- Complete roxygen2 documentation for all exported functions
- "Getting Started" vignette with end-to-end workflow example
- README with quick start guide and advanced usage examples
Testing
- 30+ unit tests covering all major functions
- Edge case handling (empty data, missing columns, invalid parameters)
- Mock API responses for offline testing
- Tests marked with
skip_on_cran()for computationally expensive operations
---
**Note**: This is the initial release. Future versions will include additional topic modeling algorithms, enhanced network analysis features, and extended visualization options.
From NEWS.md in the release
Install
Health
- OK13 OK2026-10-12
- ERROR12 OK, 1 ERROR2026-10-09
- OK13 OK2026-09-08
- ERROR12 OK, 1 ERROR2026-09-07
- OK13 OK2026-08-05
Show 6 earlier changesHide 6 earlier changes
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-04-10
- ERROR13 OK, 1 ERROR2026-04-09
- OK14 OK2026-03-10
Documentation
- Help pages
- 18 (5 internal)includes a package overview page
- Examples that run
- 8%1 run in a plain check · 12 never run
- Exported functions with examples
- 100%
- Documented parameters
- 99%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
5 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/praveenmaths89/sportminer on 2026-10-21.
This repository shows signs of AI coding tools.
- Cursorfirst seen 2026-08-20Commits: at least 2 crediting it in the message
Dependencies
Installing SportMiner adds 97 packages (63 with compiled code, 99 MB of source tarballs). Heaviest: BH 14 MB, stringi 11 MB, ggplot2 6.0 MB.
CRAN will archive these unless their check problems are fixed by the date shown. This package needs each one to install.
- stmfix by Nov 13
Code & Tests
People & History
- RR 4.6.0 released · 2026-04-24
- 0.1.0Latest2026-01-17 · current release
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2026-01-17
- Total releases
- 1 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.0.0
- Download size
- 61 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("SportMiner")The package provides a citation file, so citation() returns the authors' own entry.
The repository also keeps a CITATION.cff.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.