wristsed provides analysis-ready NHANES 2011--2014 wrist accelerometer
sedentary-time datasets. The package contains derived epoch-level and
participant-level Parquet data products based on CHAP Wrist posture predictions
combined with either SWaN sleep/wake/non-wear classifications or aligned NHANES
minute-level sleep states.
The package is intended for researchers who want to analyze derived sedentary behavior summaries without rebuilding the full raw accelerometer processing pipeline.
Install the package from GitHub:
# install.packages("remotes")
remotes::install_github("codoom1/wristsed")Load the package:
library(wristsed)The package depends on arrow, dplyr, and utils. These dependencies are
declared in the package DESCRIPTION file and are installed by standard R
package installation tools.
wristsed includes epoch-level and participant-level sedentary-time datasets.
| Level | Sleep/wake method | Epoch resolutions |
|---|---|---|
| Epoch | swan |
10m, 30m, 1h |
| Epoch | nhanes |
10m, 30m, 1h |
| Participant | swan |
1h |
| Participant | nhanes |
1h |
The primary analysis dataset uses:
sleep_method = "swan"
epoch = "1h"The sensitivity dataset uses:
sleep_method = "nhanes"Sleep/wake methods:
swan: primary analysis dataset using CHAP Wrist posture predictions combined with SWaN sleep/wake/non-wear states.nhanes: sensitivity dataset using CHAP Wrist posture summaries combined with aligned NHANES 1-minute sleep states.
List packaged data products:
available_datasets()Read the default 1-hour SWaN epoch-level dataset:
epoch_1h <- get_epoch_data()
head(epoch_1h)Read participant-level summaries:
participant <- get_participant_data()
head(participant)List participants available across both sleep/wake methods:
participants <- available_participants(sleep_method = "all")
head(participants)| Function | Purpose |
|---|---|
available_datasets() |
Lists packaged data products. |
available_participants() |
Lists participant IDs, NHANES cycle, sleep method, epoch level, and valid-day counts. |
get_epoch_data() |
Reads repeated participant-day epoch summaries. |
get_participant_data() |
Reads one-row-per-participant summaries. |
data_dictionary() |
Returns packaged data dictionaries as R objects. |
view_data_dictionary() |
Displays a packaged data dictionary in the console. |
Read the primary 1-hour epoch-level dataset:
epoch_1h <- get_epoch_data(
epoch = "1h",
sleep_method = "swan"
)Read the primary participant-level dataset:
participant <- get_participant_data(
sleep_method = "swan",
epoch = "1h"
)Read the NHANES sleep-state sensitivity dataset:
epoch_nhanes <- get_epoch_data(
epoch = "1h",
sleep_method = "nhanes"
)By default, the data accessors collect data into memory as a data frame. For
larger workflows, set collect = FALSE to return an Arrow Dataset. This allows
users to filter or select before collecting rows into memory.
library(dplyr)
epoch_ds <- get_epoch_data(
epoch = "10m",
sleep_method = "swan",
collect = FALSE
)
morning_weekdays <- epoch_ds |>
filter(DayType == "Weekday", epoch_start_minute < 12 * 60) |>
select(ID, Dataset, Day, Epoch, percent_waking_sedentary) |>
collect()Epoch-level datasets include:
ID,Dataset,Day,DayType, andEpochepoch_level,epoch_start_minute, andepoch_duration_minutessleep_methodpercent_sedentarypercent_waking_sedentarypercent_sleep_nonwearpercent_wakepercent_missing_sleepsource_coverage
Participant-level datasets include:
ID,Dataset,sleep_method, andepoch_levelsleep_nonwear_cutoffno_of_valid_daysest_sedentary_hoursest_waking_hoursest_sleep_nonwear_hours- within-participant SD and SE columns for daily estimates
- NHANES survey variables:
Exam_weight_recal,PSU, andStratum
Use participant-level datasets for nationally representative participant-level analyses because NHANES survey weights are assigned to participants, not epochs.
Detailed data dictionaries are included with the package and can be accessed directly from R.
View the epoch-level dictionary in the console:
view_data_dictionary("epoch")View the participant-level dictionary:
view_data_dictionary("participant")Return both dictionaries as R objects:
dict <- data_dictionary("all")Participant summaries are derived from the packaged 1-hour epoch data. For each sleep/wake method, a sleep/non-wear cutoff is selected from 50% to 100% in 0.01-point increments by matching estimated sleep/non-wear hours to weighted self-reported sleep. The selected cutoff is applied at the 1-hour epoch, and daily sedentary, waking, and sleep/non-wear hours are averaged across each participant's valid days.
Within-participant SD and SE columns are missing for participants with only one valid day because day-to-day variability cannot be estimated from a single observed day.
If you use wristsed, please cite the package, the accompanying manuscript,
and the source methods for posture and sleep/non-wear classification.
In R, run:
citation("wristsed")The package data product accompanies the manuscript:
Odoom C. Sedentary Behavior in the United States Measured by Accelerometer, NHANES 2011--2014. Manuscript in preparation. 2026.
The derived datasets build on NHANES wrist accelerometer data, CHAP posture
classification methods, and SWaN sleep/wake/non-wear classification. Full
citation details are available through citation("wristsed").
Relevant method DOIs:
- CHAP-Adult: https://doi.org/10.1123/jmpb.2021-0062
- CHAP validation study: https://doi.org/10.1249/MSS.0000000000002705
- SWaN sleep/non-wear method: https://doi.org/10.1249/MSS.0000000000002973
This package is licensed under the Apache License 2.0. See the LICENSE file
for details.