% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scores_nt_fitbit.R
\name{compute_fitbit_sleep_week}
\alias{compute_fitbit_sleep_week}
\title{Generates weekly sleep summaries from daily Fitbit sleep data.}
\usage{
compute_fitbit_sleep_week(df, filter_expr = qc_300min)
}
\arguments{
\item{df}{tbl. Daily-level Fitbit sleep dataset (standard or extended),
typically \code{fitbit_ss_sleep_day} or \code{fitbit_ss_ext_sleep_day}.}

\item{filter_expr}{expression. Logical filtering condition applied to the
input dataset before summarization (e.g., QC thresholds).}
}
\value{
tbl. Weekly sleep dataset containing:
\itemize{
\item Week identifiers (\code{wk}, \code{wk_type})
\item Day counts (\code{n_day}, \code{n_wkdy}, \code{n_wknd})
\item Sleep timing metrics (bed/sleep onset and offset)
\item Sleep duration and stage summaries
\item Heart rate–derived sleep metrics
\item Wake-after-sleep-onset metrics
\item Weekly quality control flag (\code{qc_wk})
}
}
\description{
This wrapper function applies a standardized weekly aggregation pipeline
using \code{compute_fitbit_weekly_summary()} and the \code{summarize_sleep()} function
to compute weekly sleep metrics at the participant-session level.

Only days passing minimum quality control thresholds (\code{qc_300min}) are
included in the weekly aggregation.
}
\details{
This function ensures consistent weekly aggregation of sleep metrics across
standard and extended Fitbit datasets. It inherits QC filtering from the
parent pipeline and preserves both total and stage-specific sleep summaries.
}
\note{
\itemize{
\item \code{df}: fitbit_ss_sleep_day or fitbit_ss_ext_sleep_day
(daily Fitbit sleep dataset with QC flags)
}
}
