% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/environment-confounds-and-ipfm.R
\name{extract_gazepoint_beats_kmeans}
\alias{extract_gazepoint_beats_kmeans}
\title{Extract heartbeat candidates from Gazepoint pulse using k-means}
\usage{
extract_gazepoint_beats_kmeans(
  dat,
  pulse_col = "HRP",
  time_col = "CNT",
  group_cols = NULL,
  k = 2,
  peak_polarity = c("positive", "negative"),
  min_distance_s = 0.3,
  sampling_rate = NULL,
  seed = NULL
)
}
\arguments{
\item{dat}{A data frame.}

\item{pulse_col}{Numeric pulse/PPG column.}

\item{time_col}{Numeric time column.}

\item{group_cols}{Optional grouping columns.}

\item{k}{Number of k-means clusters.}

\item{peak_polarity}{\code{"positive"} or \code{"negative"}.}

\item{min_distance_s}{Minimum time between selected beats.}

\item{sampling_rate}{Optional sampling rate in Hz.}

\item{seed}{Optional random seed.}
}
\value{
A list with \code{overview}, \code{beat_table}, \code{interval_table},
\code{timeseries}, and \code{settings}.
}
\description{
Uses k-means clustering on the raw pulse waveform to classify likely
heartbeat regions and then selects local extrema as beat candidates. This is
a Gazepoint Biometrics-oriented fallback for difficult pulse waveforms, not
an ECG-equivalent R-peak detector.
}
