Prepares the staging tibble produced by stage_epochs() for
downstream use with the hypnor package. Attaches recording metadata as
attributes and returns a tibble of class mrpheus_hypnogram, which
hypnor::new_hypnogram() accepts directly once hypnor is installed.
Arguments
- staging
A tibble from
stage_epochs()with columnsepoch,stage, and optional probability columns.- epoch_s
Numeric. Epoch duration in seconds. Must match the
epoch_sused inprepare_psg(). Default30.- start_time
POSIXct or
NULL. Recording start time. Used to compute clock-time axes inhypnorplots. IfNULL, epochs are indexed from 0.- participant_id
Character or
NULL. Optional identifier passed through tohypnorandsyncR.
Value
A tibble of class mrpheus_hypnogram with columns epoch, stage,
and any probability columns from the staging model. Metadata (epoch_s,
start_time, participant_id, source, resolution) are attached as
attributes and forwarded to hypnor::new_hypnogram() when hypnor is
available.