Skip to contents

Import & tidy

Read and clean data exported from the Sleep Diaries app.

read_export()
Read a single Sleep Diaries JSON export
read_study()
Read a directory of Sleep Diaries JSON exports into a study object

Compute

Calculate sleep variables from diary entries.

compute_sleep_vars()
Compute derived sleep variables from raw morning diary answers

Questionnaires

Score validated one-time questionnaires (ESS, ISI, PSQI, MEQ, …).

score_all_questionnaires()
Re-score all questionnaires in a study or export
score_questionnaire()
Score a Sleep Diaries questionnaire from raw answers
available_instruments()
List available questionnaire instruments

Datasets

Example data included with the package.

diary_long()
Extract the long-format diary data frame from a study or export
diary_wide()
Pivot diary entries to wide format — one row per participant per night
study_summary()
Summarise a study's diary data at the participant level

Package

Package-level documentation.