Complexity and nonlinear time series analysis for physiological signals β entropy, fractal/multifractal measures, Lyapunov exponents, multiscale metrics, and recurrence quantification analysis.
[!WARNING] Rtractor is in early development and several planned families are not yet implemented (Lyapunov exponents, phase-space embedding, general recurrence quantification measures). Implemented functions have been validated against reference implementations or ground-truth synthetic data where one exists (see each function's documentation and
inst/COPYRIGHTS), but the package as a whole has not undergone peer review and the API may change without notice. Verify outputs independently before using in any research context.
Rtractor is a shared "complexity toolkit" for the Circadia Lab / CoDe-Neuro
Lab ecosystem: a single home for the nonlinear dynamics and complex-systems
measures (entropy, fractal dimension, Lyapunov exponents, multiscale
entropy, recurrence quantification) that otherwise get reimplemented
piecemeal inside signal-specific packages like mrpheus, zeitR, and
dynR.
Like hypnoR, Rtractor is signal-agnostic: every metric accepts a plain
numeric time series regardless of where it came from β EEG, actigraphy,
BOLD, HRV, or anything else β rather than assuming a specific data source or
staging scheme.
Where possible, Rtractor wraps existing, well-validated C/C++/Fortran reference implementations via Rcpp rather than reimplementing algorithms from scratch in R, to preserve numerical parity with the original methods literature.
theme_rtractor()
None of the Lyapunov metric functions are implemented yet. Currently
working: dfa(), higuchi_fd(), mfdma(), chhabra_jensen(),
petrosian_fd(), hjorth_parameters(), num_zerocross() (fractal
family), perm_entropy(), sample_entropy() (entropy family),
multiscale_entropy() (multiscale family), recurrence_microstate_entropy()
(RQA family), and pmodel() (simulate family, for generating synthetic
test signals). See NEWS.md for progress.
Rtractor/
βββ R/
β βββ Rtractor-package.R # package-level doc / Rcpp registration
β βββ entropy.R # perm_entropy(), sample_entropy()
β βββ fractal.R # dfa(), higuchi_fd(), mfdma(), chhabra_jensen(),
β β # petrosian_fd(), hjorth_parameters(), num_zerocross()
β βββ lyapunov.R # planned: Rosenstein/Wolf
β βββ multiscale.R # multiscale_entropy(); planned: RCMSE
β βββ rqa.R # recurrence_microstate_entropy(); planned: RQA measures
β βββ embed.R # planned: phase-space reconstruction utils
β βββ simulate.R # pmodel() -- synthetic multifractal test signals
β βββ palettes.R # rtractor_palette(), rtractor_palettes()
β βββ scales.R # scale_{colour,fill}_rtractor(_c)()
β βββ theme.R # theme_rtractor()
βββ src/
β βββ dfa.cpp # DFA β wraps PhysioNet's dfa.c (GPL-2+)
β βββ higuchi.cpp # Higuchi FD β clean-room reimplementation
β βββ fractal_multifractal.cpp # MFDMA, Chhabra-Jensen β clean-room
β βββ fractal_nonlinear.cpp # Petrosian FD, Hjorth, zero-crossings β from mrpheus
β βββ entropy.cpp # Permutation entropy β from mrpheus
β βββ sample_entropy.cpp # Sample/multiscale entropy β wraps PhysioNet's mse.c (GPL-2+)
β βββ microstates.cpp # Recurrence microstates entropy β wraps MIT code
βββ inst/
β βββ COPYRIGHTS # attribution for wrapped/ported reference code
βββ vignettes/
β βββ getting-started.Rmd # tour of every implemented family
β βββ multifractal-methods.Rmd # mfdma() vs chhabra_jensen(), validated against pmodel() ground truth
β βββ entropy-and-complexity.Rmd # perm_entropy/sample_entropy/multiscale_entropy, white noise vs correlated signal
βββ tests/testthat/
βββ man/
βββ DESCRIPTION
βββ NEWS.md
src/
Rcpp components# once published on r-universe:
install.packages("Rtractor", repos = c(
"https://circadia-bio.r-universe.dev",
"https://cloud.r-project.org"
))
# or directly from GitHub:
remotes::install_github("circadia-bio/Rtractor")
| Package | Purpose |
|---|---|
| Rcpp | Wrapping C/C++/Fortran reference implementations |
| ggplot2 (Suggests) |
theme_rtractor() and the scale_*_rtractor() family |
| testthat (Suggests) | Unit testing |
| Role | Name | Affiliation |
|---|---|---|
| Author, maintainer | Lucas FranΓ§a | Northumbria University, Circadia Lab |
| Author | Mario Leocadio-Miguel | Northumbria University, Circadia Lab |
Released under the GNU General Public License, version 2 or later (GPL (>= 2)).
Some wrapped reference implementations are themselves GPL-licensed β see
inst/COPYRIGHTS for attribution and citation
requirements.
Copyright Β© Circadia Lab, 2026