Skip to contents

From a set of grouped candidate peaks restricted to the wake period, selects the first peak occurring after wake onset that satisfies the validity conditions applied upstream.

Usage

select_first_peak(peaks, wake_time)

Arguments

peaks

A data frame of grouped peaks, as returned by group_peaks().

wake_time

POSIXct scalar, timestamp of wake onset.

Value

A single-row data frame describing the selected peak, or NULL if no valid peak is found.