When taking the raw RR output from a Garmin watch, most of the entries are 65.535, which is just an empty measurement, as no new heartbeat has been detected yet.

rr_validate_measure_artifacts(
  rr_segment,
  is_valid = rep(TRUE, length(rr_segment))
)

Arguments

rr_segment

A numeric vector of RR intervals (in milliseconds).

is_valid

A logical vector indicating which intervals are valid initially. Defaults to all TRUE.

Value

A list containing two elements:

is_valid

A logical vector of the same length as rr_segment, where TRUE indicates a valid RR interval and FALSE indicates an invalid interval.

cleaned_rr

A numeric vector containing only the valid RR intervals.