Calculates summary sleep architecture metrics from staged sleep data.
Requires that eegSleepStage() has been run and results are stored
in metadata(x)$sleep_stages.
Value
A data.frame with columns:
- metric
Character name of the sleep metric.
- value
Numeric value of the metric.
- unit
Character unit of measurement.
Metrics include:
total_sleep_time: Time in N1+N2+N3+REM (minutes)sleep_efficiency: TST / total recording time * 100 (percent)waso: Wake after sleep onset (minutes)sleep_latency: Time to first non-Wake epoch (minutes)rem_latency: Time from first sleep to first REM (minutes)pct_N1: Percentage of TST in N1pct_N2: Percentage of TST in N2pct_N3: Percentage of TST in N3pct_REM: Percentage of TST in REMpct_W: Percentage of total time in Wake
References
Berry, R. B., et al. (2017). AASM Scoring Manual Updates for 2017. Journal of Clinical Sleep Medicine, 13(5), 665-666.
Examples
if (FALSE) { # \dontrun{
pe <- make_eeg_sleep(n_time = 150000, n_channels = 2, sr = 500)
stages <- eegSleepStage(pe, epoch_sec = 30)
metadata(pe)$sleep_stages <- stages
metrics <- eegSleepMetrics(pe)
print(metrics)
} # }