% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scores_nt_fitbit.R
\name{compute_fitbit_sleep_hr_exclusions}
\alias{compute_fitbit_sleep_hr_exclusions}
\title{Compute total minutes excluded by heart rate criteria}
\usage{
compute_fitbit_sleep_hr_exclusions(data, bin_minutes = NULL)
}
\arguments{
\item{data}{tbl. Data frame heart rate columns \code{is_slp}, \code{session_id},
\code{dtt}, \code{hrate_excluded}, \code{hrate_low}, \code{hrate_hi} (optional), \code{hrate_no},
\code{hrate_repeat_actv}, and \code{hrate_repeat_slp} in 30-second resolution.}

\item{bin_minutes}{numeric, positive whole number. Number of minutes to bin
data by. If NULL, defaults to sleep_date column created from \code{make_offset}
function.}
}
\value{
tbl. The input data frame with the following additional columns:
\itemize{
\item \code{excl_min_total_slp}: Total number of sleep minutes excluded by heart rate
criteria.
\item \code{excl_min_lowhrate_slp}: Total number of sleep minutes excluded by low
heart rate criteria.
\item \code{excl_min_highhrate_slp}: Total number of sleep minutes excluded by
high heart rate criteria (if \code{hrate_hi} exists). Column is not created if
\code{hrate_hi} does not exist.
\item \code{excl_min_nohrate_slp}: Total number of sleep minutes excluded by
missing heart rate criteria.
\item \code{excl_min_repeathrate_slp}: Total number of sleep minutes excluded by
repeat heart rate criteria.
\item \code{min_extra_nohrate_slp}: Total number of minutes of plausible sleep
minutes but excluded for missing heart rate.
\item \code{start}: If non-daily bin selected (i.e. != 1440 minutes), start time
stamp of bin.
\item \code{end}:  If non-daily bin selected (i.e., != 1440 minutes), end time
stamp of the bin.
}
}
\description{
Computes heart rate based exclusions by sleep offset or by specified time
bins (e.g., 15-min, 30-min, 60-min).
}
\note{
input data should be output of \code{join_sleep30_and_exclusion()}. Input
data must be in 30-second epochs. \code{min_wake} includes minutes with stage of
"wake", "awake", "unknown", or NA  (for activity minutes that become sleep
under extended framework).
\itemize{
\item data input: exclusion data in offset format
}
}
\keyword{internal}
