Learn R Programming

CircaCP (version 0.1.2)

Sleep and Circadian Metrics Estimation from Actigraphy Data

Description

A generic sleep–wake cycle detection algorithm for analyzing unlabeled actigraphy data. The algorithm has been validated against event markers using data from the Multi-Ethnic Study of Atherosclerosis (MESA) Sleep study, and its methodological details are described in Chen and Sun (2024) . The package provides functions to estimate sleep metrics (e.g., sleep and wake onset times) and circadian rhythm metrics (e.g., mesor, phasor, interdaily stability, intradaily variability), as well as tools for screening actigraphy quality, fitting cosinor models, and performing parametric change point detection. The workflow can also be used to segment long actigraphy sequences into regularized structures for physical activity research.

Copy Link

Version

Install

install.packages('CircaCP')

Monthly Downloads

200

Version

0.1.2

License

GPL (>= 3)

Maintainer

Shanshan Chen

Last Published

November 12th, 2025

Functions in CircaCP (0.1.2)

cp_detect

Detect a single change point (parametric methods)
extract_sleep_metrics

Extract metrics related to sleep and circadian rhythm after using CircaCP algorithm
extract_sw_period

Extract contiguous sleep or wake periods from a labeled minute series
CircaCP-package

CircaCP: Actigraphy Import, Screening, and Circadian Metrics
import_acti_file

Import actigraphy with header stripping and harmonized Activity
screen_wear

Screen wear and extract the longest valid minute-level segment
extract_nonparametric_metrics

Nonparametric circadian metrics (RA, IS, IV, L5, M10)
sleep_cos

Estimates circadian cycle by cosinor fit of minute-level activity (period = 1440)
sleep_detection

Estimate precise sleep_wake cycles using CircaCP algorithm
actigraphy

Example Actigraphy Dataset