% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scores_nt_fitbit.R
\name{flag_implausible_sleep}
\alias{flag_implausible_sleep}
\title{Flag Implausible Sleep Periods}
\usage{
flag_implausible_sleep(dt, min_minutes = 30, epoch_seconds = 60)
}
\arguments{
\item{dt}{tbl. Data frame with \code{participant_id}, \code{dtt}, \code{is_slp}, \code{hrate_no},
and \code{hrate_repeat_actv} columns. This should be the output of
\code{identify_hr_exclusions()} or 'identify_hr_recovery()'.}

\item{min_minutes}{numeric, positive whole number. Minimum number of
consecutive HR-flagged "awake" minutes required to flag an implausible sleep
period.}

\item{epoch_seconds}{numeric, positive whole number. Duration of each epoch
in seconds.}
}
\value{
tbl. A dataframe that returns a row for each flagged implausible
sleep event:
\itemize{
\item \code{participant_id}: Participant identifier.
\item \code{dtt}: Timestamp of the start of the flagged HR issue run.
}
}
\description{
Identifies days containing implausible sleep periods by detecting sequences
of heart rate issues that immediate follow sleep runs. A sleep period is
considered implausible when a sufficiently long run of HR-flagged "awake"
minutes immediate follows a sleep run that contained no HR issues, suggesting
the device may have been have been removed or malfunctioned during what was
recorded as sleep.
}
\note{
\itemize{
\item input: output of identify_hr_exclusions; need exclusions flags
}
}
\keyword{internal}
