compute_run_data_loss: Compute percent data lost for a given run/block

View source: R/utils-render_report.R

compute_run_data_lossR Documentation

Compute percent data lost for a given run/block

Description

Calculates the proportion of samples in the raw pupil timeseries that are invalid (i.e., missing/during a blink, or off-screen) and expresses it as a percentage. This surfaces data loss directly in the report to reinforce workflow transparency.

Usage

compute_run_data_loss(eyeris, run_num, eye_suffix = NULL)

Arguments

eyeris

An eyeris object containing preprocessing results

run_num

Run identifier (numeric or character, e.g. 1 or "01")

eye_suffix

Optional eye suffix (e.g., "eye-L", "eye-R") used to select the correct eye from a binocular object

Details

Prefers the canonical prop_invalid metric stored in eyeris$confounds$unepoched_timeseries (computed by summarize_confounds()). Falls back to computing the proportion of missing samples directly from the raw timeseries when confounds are unavailable.

Value

A numeric percentage in ⁠[0, 100]⁠, or NA_real_ when it cannot be determined


eyeris documentation built on June 19, 2026, 9:08 a.m.