Package: actiRhythm 0.1.0

actiRhythm: Circadian Rest-Activity Rhythm Analysis

Quantifies the circadian rest-activity rhythm, the roughly 24-hour cycle of activity and rest, from activity counts and raw accelerometer recordings. Analyses run on an activity-count vector and its timestamps, and a built-in reader loads 'ActiGraph' '.agd' files (an 'SQLite' database) directly. Computes nonparametric metrics (interdaily stability (IS) and intradaily variability (IV) following Witting et al. (1990) <doi:10.1016/0006-3223(90)90523-5>; relative amplitude (RA), the least-active 5-hour window (L5), and the most-active 10-hour window (M10) following Van Someren et al. (1999) <doi:10.3109/07420529908998724>), cosinor models with a rhythmicity test, confidence ellipses, population-mean cosinor, and two-group parameter comparison (Cornelissen (2014) <doi:10.1186/1742-4682-11-16>; Marler et al. (2006) <doi:10.1002/sim.2466>), period estimation by Lomb-Scargle (Lomb (1976) <doi:10.1007/BF00648343>; Scargle (1982) <doi:10.1086/160554>) and chi-square (Sokolove and Bushell (1978) <doi:10.1016/0022-5193(78)90022-X>) periodograms with bootstrap confidence intervals and a sliding-window spectrogram, fractal and nonlinear measures (Peng et al. (1994) <doi:10.1103/PhysRevE.49.1685>; Kantelhardt et al. (2002) <doi:10.1016/S0378-4371(02)01383-3>), the Sleep Regularity Index (Phillips et al. (2017) <doi:10.1038/s41598-017-03171-4>), social jet lag, rest-activity state transitions, and locomotor inactivity during sleep (Winnebeck et al. (2018) <doi:10.1016/j.cub.2017.11.063>). It also reads raw accelerometer files ('ActiGraph' '.gt3x', 'Axivity' '.cwa', 'GENEActiv' '.bin'), auto-calibrates them (van Hees et al. (2014) <doi:10.1152/japplphysiol.00421.2014>), and derives the ENMO, MAD, and z-angle metrics with diary-free sleep-period detection (van Hees et al. (2018) <doi:10.1038/s41598-018-31266-z>), cross-checked against 'GGIR'. A batch mode runs the analysis over a folder of files and writes a multi-sheet 'Excel' workbook.

Authors:Raymond Dacosta Azadda [aut, cre], CEAL Team [aut], Stacy Rasmus [aut]

actiRhythm_0.1.0.tar.gz
actiRhythm_0.1.0.zip(r-4.7-x86_64)actiRhythm_0.1.0.zip(r-4.7-arm64)actiRhythm_0.1.0.zip(r-4.6-x86_64)actiRhythm_0.1.0.zip(r-4.6-arm64)actiRhythm_0.1.0.zip(r-4.5-x86_64)
actiRhythm_0.1.0.tgz(r-4.6-x86_64)actiRhythm_0.1.0.tgz(r-4.6-arm64)actiRhythm_0.1.0.tgz(r-4.5-x86_64)actiRhythm_0.1.0.tgz(r-4.5-arm64)
actiRhythm_0.1.0.tar.gz(r-4.7-arm64)actiRhythm_0.1.0.tar.gz(r-4.7-x86_64)actiRhythm_0.1.0.tar.gz(r-4.6-arm64)actiRhythm_0.1.0.tar.gz(r-4.6-x86_64)
actiRhythm_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
actiRhythm/json (API)

# Install 'actiRhythm' in R:
install.packages('actiRhythm', repos = c('https://rdazadda.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/rdazadda/actirhythm/issues

Pkgdown/docs site:https://rdazadda.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

cpp

5.09 score 31 scripts 439 downloads 113 exports 29 dependencies

Last updated from:c824a1b67e. Checks:13 NOTE, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64NOTE256
linux-devel-x86_64NOTE302
source / vignettesOK267
linux-release-arm64NOTE250
linux-release-x86_64NOTE300
macos-release-arm64NOTE293
macos-release-x86_64NOTE516
macos-oldrel-arm64NOTE281
macos-oldrel-x86_64NOTE513
windows-devel-arm64NOTE543
windows-devel-x86_64NOTE339
windows-release-arm64NOTE553
windows-release-x86_64NOTE338
windows-oldrel-x86_64NOTE327
wasm-releaseOK155

Exports:actiRhythm_colorsactivity.balance.indexactivity.extremaactivity.onset.offsetagd.countsauto.calibrateaxivity.countsbackend_infochi.sq.periodogramcircadian_cppcircadian.batchcircadian.dailycircadian.emdcircadian.flmcircadian.is.multiscalecircadian.onset.cicircadian.periodcircadian.quotientcircadian.rawcircadian.rhythmcircadian.spectrogramcircadian.ssacircadian.waveletcircadian.workbookcomposite.phase.deviationconsensus.rhythmicitycosinor.analysiscosinor.antilogisticcosinor.comparecosinor.confidence.ellipsecosinor.extendedcosinor.multicomponentcounts.from.data.framecpp_availablecurve.registrationdetect.nonwear.choidetect.nonwear.rawdetect.nonwear.troianodichotomy.indexexample_agdexample_rawfractal.dfageneactiv.countsgt3x.countsgt3x.to.agdhas.inclinometerhilbert.huangintradaily.variability.multiscaleIS_cppIV_cppL5M10_cpplidsmfdfamultiscale.entropyperiod.ciphase.concentrationplot_actogramplot_changepointsplot_chisqplot_cosinor_ellipseplot_cosinor_schematicplot_dfaplot_dichotomyplot_emdplot_extended_cosinorplot_lidsplot_mfdfaplot_mseplot_multicomponentplot_multiscaleplot_period_ciplot_periodogramplot_phase_roseplot_profileplot_raw_metricsplot_rest_comparisonplot_sptplot_ssa_wcorplot_transitionsplot_waveletpopulation.cosinorraw.metricsread.actigraph.csvread.agdread.rawresidual.spectrumrest.activity.fragmentationrest.cresporest.hmmrest.periodsrest.sptrhythmicity.testrolling_meanrolling_sdrolling_sumsave.circadian.plotscale_color_actiRhythmscale_fill_actiRhythmset_actiRhythm_themesib.vanheessleep.changepointssleep.cole.kripkesleep.from.sptsleep.regularity.indexsleep.sadehsocial.jet.lagsri.matrixstate.transitionstheme_actiRhythmtransition.probabilityultradian.bandpowerwavelet.coiwrite.agd

Dependencies:bitbit64blobcachemclicpp11DBIfarverfastmapggplot2gluegtableisobandlabelinglifecyclememoisepkgconfigR6rbibutilsRColorBrewerRcppRdpackrlangRSQLiteS7scalesvctrsviridisLitewithr

Getting started with actiRhythm
The recording | The nonparametric rhythm | Cosinor and the rhythmicity test | The period | Watching the period drift | Nonlinear structure | Rest-activity transitions | Pinpointing sleep and wake | Every rest bout, naps included | Scoring sleep and its regularity | Pooling the evidence | A one-row summary | A whole study at once | Where next | References

Last update: 2026-07-18
Started: 2026-06-24

Output codebook (metrics data dictionary)
Reading this codebook | Recording descriptors | Nonparametric metrics | Cosinor and rhythmicity | Period and spectral | Fractal and nonlinear | Rest-activity transitions | Sleep timing and regularity | References

Last update: 2026-07-02
Started: 2026-06-26

Readme and manuals

Help Manual

Help pageTopics
actiRhythm Color GeneratoractiRhythm_colors
Activity Balance Indexactivity.balance.index
Generalized Least- and Most-Active Periods (MX / LX)activity.extrema
Activity Onset and Offset (Relative-Difference Phase Markers)activity.onset.offset
Extract Counts from .agd Dataagd.counts
Auto-Calibrate Raw Acceleration to the Unit Gravity Sphereauto.calibrate
Activity Counts from a Raw Axivity .cwa Fileaxivity.counts
Backend Informationbackend_info
Chi-square (Sokolove-Bushell) Periodogramchi.sq.periodogram
Complete Circadian Analysiscircadian_cpp
Circadian Rhythm Analysiscircadian-analysis
Fractal and Complexity Metrics for Activity Time Seriescircadian-fractal
Endogenous Circadian Period Estimation (Lomb-Scargle)circadian-period
Circadian Rhythm Visualizationscircadian-plots
Batch Circadian Analysis of Multiple AGD Filescircadian.batch
Per-Day Nonparametric Metricscircadian.daily
Empirical Mode Decomposition of the Activity Rhythmcircadian.emd
Functional Linear Model of the 24-Hour Activity Profilecircadian.flm
Multi-resolution Interdaily Stability (IS)circadian.is.multiscale
Confidence Intervals for L5/M10 Onset Timingcircadian.onset.ci
Estimate Endogenous Circadian Period via the Lomb-Scargle Periodogramcircadian.period
Circadian Quotient and Relative Amplitude from a Cosinor Fitcircadian.quotient
Circadian Analysis Directly from Raw Accelerationcircadian.raw
Circadian Rhythm Analysiscircadian.rhythm
Circadian Spectrogram (Period over Time)circadian.spectrogram
Singular Spectrum Analysis of an Activity Seriescircadian.ssa
Continuous Wavelet Transform of the Activity Rhythmcircadian.wavelet
Export a Full Circadian Analysis to an Excel Workbookcircadian.workbook
Composite Phase Deviation (Fischer & Roenneberg, 2016)composite.phase.deviation
Consensus Rhythmicity Across Methodsconsensus.rhythmicity
Cosinor Analysis for Circadian Rhythmcosinor.analysis
Anti-Logistic (Extended) Cosinor Analysis (Marler et al. 2006)cosinor.antilogistic
Compare Cosinor Rhythms Between Two Groupscosinor.compare
Joint Amplitude-Acrophase Confidence Ellipse (Bingham et al. 1982)cosinor.confidence.ellipse
Multi-Component Cosinor Analysis with Harmonicscosinor.extended
Multicomponent Cosinor with Model Selectioncosinor.multicomponent
Activity Counts from a Data Framecounts.from.data.frame
Check C++ Availabilitycpp_available
Curve Registration of Daily Activity Profilescurve.registration
Choi (2011) Non-Wear Detectiondetect.nonwear.choi
Non-Wear Detection from Raw Accelerationdetect.nonwear.raw
Troiano (2008) Non-Wear Detectiondetect.nonwear.troiano
Dichotomy Index (I < O)dichotomy.index
Get Path to Example AGD Filesexample_agd
Synthetic Raw Acceleration Recordingexample_raw
Detrended Fluctuation Analysis (DFA)fractal.dfa
Activity Counts from a Raw GENEActiv .bin Filegeneactiv.counts
Activity Counts from a Raw .gt3x Filegt3x.counts
Convert a Raw .gt3x File to an .agd Filegt3x.to.agd
Check if AGD Data Has Inclinometer Informationhas.inclinometer
Hilbert-Huang Instantaneous Phase and Frequencyhilbert.huang
Multiscale Intradaily Variability (IVm)intradaily.variability.multiscale
Interdaily Stability (IS)IS_cpp
Intradaily Variability (IV)IV_cpp
Calculate L5/M10 Circadian MetricsL5M10_cpp
Locomotor Inactivity During Sleep (LIDS)lids
Multifractal Detrended Fluctuation Analysis (MF-DFA)mfdfa
Multiscale Sample Entropy (MSE)multiscale.entropy
Confidence Interval for the Endogenous Circadian Periodperiod.ci
Phase Concentration Testsphase.concentration
Double-Plotted Actogramplot_actogram
Sleep / Wake Change-Point Trackplot_changepoints
Plot the Chi-Square (Sokolove-Bushell) Periodogramplot_chisq
Cosinor Amplitude-Acrophase Confidence Ellipseplot_cosinor_ellipse
Annotated Cosinor Parameter Schematicplot_cosinor_schematic
Plot the Detrended Fluctuation Analysis (DFA) Scaling Relationshipplot_dfa
Dichotomy Index Plotplot_dichotomy
Empirical Mode Decomposition Stackplot_emd
Plot the Extended (Marler) Cosinor Fit on the 24-Hour Activity Profileplot_extended_cosinor
LIDS Ultradian Cycle Curveplot_lids
Multifractal DFA Spectrumplot_mfdfa
Multiscale Entropy Curveplot_mse
Single Cosine vs Multicomponent Cosinor Fitplot_multicomponent
Multiscale IS and IV Profilesplot_multiscale
Bootstrap Period Confidence Intervalplot_period_ci
Plot the Lomb-Scargle Periodogram with the Endogenous Periodplot_periodogram
Circular Phase Roseplot_phase_rose
Average-Day Profile with the L5 and M10 Windowsplot_profile
Raw-Acceleration Epoch Metrics Profileplot_raw_metrics
Rest-Detector Comparison Stripplot_rest_comparison
z-Angle Sleep-Period-Time Detectionplot_spt
SSA w-Correlation Matrixplot_ssa_wcor
Rest-Activity Transition Curvesplot_transitions
Wavelet Power Scalogramplot_wavelet
Plot Circadian Rhythm Profileplot.actiRhythm_circadian
Population-Mean Cosinor (Bingham)population.cosinor
Print Method for Circadian Rhythm Resultsprint.actiRhythm_circadian
Print method for cosinor analysisprint.actiRhythm_cosinor
Print method for extended cosinor analysisprint.actiRhythm_cosinor_extended
Print Method for DFA Resultsprint.actiRhythm_dfa
Print Method for Multiscale Entropy Resultsprint.actiRhythm_mse
Raw-Acceleration Epoch Metrics (ENMO, MAD, z-Angle)raw.metrics
Read an ActiGraph (ActiLife) Epoch CSVread.actigraph.csv
Read ActiGraph .agd Fileread.agd
Activity Counts from a Raw Accelerometer File (Any Supported Brand)read.raw
Residual Circadian Spectrumresidual.spectrum
Rest-Activity Bout Fragmentationrest.activity.fragmentation
Crespo Rest/Activity Period Detectionrest.crespo
State-Space (Hidden Markov) Rest-Activity Modelrest.hmm
Consolidated Rest-Period Detection (Roenneberg / MASDA)rest.periods
Sleep-Period-Time Window from the z-Angle (HDCZA)rest.spt
Cosinor Rhythmicity Testrhythmicity.test
Rolling Meanrolling_mean
Rolling Standard Deviationrolling_sd
Rolling Sumrolling_sum
Save a actiRhythm Plot to a Filesave.circadian.plot
ggplot2 Scale for actiRhythm Colorsscale_color_actiRhythm
ggplot2 Fill Scale for actiRhythm Colorsscale_fill_actiRhythm
Set actiRhythm Theme as Defaultset_actiRhythm_theme
Sustained-Inactivity-Bout Sleep Scoring from the z-Anglesib.vanhees
Change-Point Detection of Sleep and Wake Onsetssleep.changepoints
Cole-Kripke Sleep/Wake Scoringsleep.cole.kripke
Sleep Parameters from SPT and Sustained-Inactivity Boutssleep.from.spt
Calculate Sleep Regularity Index (SRI) - Exported Versionsleep.regularity.index
Sadeh Sleep/Wake Scoringsleep.sadeh
Calculate Social Jet Lagsocial.jet.lag
Sleep Regularity Index (SRI) - Phillips (2017) Epoch-of-Day x Day Matrixsri.matrix
Rest-Activity State Transition Rates (kRA, kAR)state.transitions
actiRhythm ggplot2 Themetheme_actiRhythm
Rest-Active Transition Probabilitiestransition.probability
Ultradian Wavelet Band Powerultradian.bandpower
Wavelet Cone of Influencewavelet.coi
Write Activity Counts to an .agd Filewrite.agd