| compute_block_counts | R Documentation |
This function evaluates sleep blocks and identifies whether each sleep day contains a single valid main sleep episode based on a minimum duration threshold.
compute_block_counts(data, main_dur)
data |
tbl. Sleep block-level dataset containing at minimum:
|
main_dur |
numeric. Minimum block duration (in minutes) required for a sleep block to be considered a main sleep period. |
The function is used to assess sleep fragmentation at the block level by
counting how many blocks satisfy both the main_block flag and the
minimum duration requirement. This is commonly used in extended sleep
pipelines to distinguish consolidated sleep from fragmented sleep patterns.
tbl. A summarized data frame at the participant-day level with:
n: Number of main sleep blocks meeting the minimum duration threshold.
single_block: Logical indicator of whether exactly one valid main sleep
episode is present.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.