| Title: | Process and Report Gazepoint Biometrics Data |
|---|---|
| Description: | Gazepoint-native tools for reproducible analysis and reporting of Gazepoint Biometrics and GP3-derived physiological, gaze, pupil, fixation, AOI, marker, and event-level exports. The package supports import, validation, preprocessing, missing-value imputation, EDA/GSR, SCR epoching, IBI/RR/HRV, PPG/pulse workflows, pupil blink detection and cleaning, gaze filtering, fixation summaries, engagement-dial indices, multimodal trial regressors, quality reports, exclusion and QC recommendations, synthetic eye-data generation, and interoperability or workflow-inspired helpers for common psychophysiology toolchains. The package is designed for transparent, CRAN-safe, scriptable analysis rather than as a full clone of external commercial or open-source toolboxes. |
| Authors: | Stefanos Balaskas [aut, cre] |
| Maintainer: | Stefanos Balaskas <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.1.0 |
| Built: | 2026-10-09 21:26:17 UTC |
| Source: | https://github.com/stefanosbalaskas/gpbiometrics |
Add one structured record to a decision log created with
create_gazepoint_analysis_decision_log().
add_gazepoint_decision( log, stage, object_type, object_id = NA_character_, decision, reason = NA_character_, function_name = NA_character_, parameter = NA_character_, value = NA_character_, reviewer_note = NA_character_, timestamp = Sys.time() )add_gazepoint_decision( log, stage, object_type, object_id = NA_character_, decision, reason = NA_character_, function_name = NA_character_, parameter = NA_character_, value = NA_character_, reviewer_note = NA_character_, timestamp = Sys.time() )
log |
A decision log created with
|
stage |
Workflow stage, for example |
object_type |
Type of object affected by the decision, for example
|
object_id |
Identifier for the affected object. |
decision |
Compact decision label. |
reason |
Reason for the decision. |
function_name |
Optional function associated with the decision. |
parameter |
Optional parameter name. |
value |
Optional parameter value. Non-scalar values are collapsed into a compact character string. |
reviewer_note |
Optional reviewer-facing note. |
timestamp |
Optional timestamp. Defaults to the current time. |
Updated decision log.
Aligns biometric rows to TTL/event markers and returns event-relative time and sample indices. The helper is conservative: TTL events are detected from rising edges by default, validity flags are used when available, and no physiological interpretation is added.
align_gazepoint_biometrics_to_ttl( data, ttl_cols = NULL, event_col = NULL, ttl_valid_col = NULL, time_col = NULL, sample_col = NULL, group_cols = NULL, participant_col = NULL, stimulus_col = NULL, trial_col = NULL, event_value = NULL, valid_values = c(TRUE, 1, "1"), event_edge = c("rising", "change", "active"), pre_window_ms = 1000, post_window_ms = 5000, pre_window_samples = NULL, post_window_samples = NULL, collapse_nearby_ms = 0, require_valid_ttl = TRUE )align_gazepoint_biometrics_to_ttl( data, ttl_cols = NULL, event_col = NULL, ttl_valid_col = NULL, time_col = NULL, sample_col = NULL, group_cols = NULL, participant_col = NULL, stimulus_col = NULL, trial_col = NULL, event_value = NULL, valid_values = c(TRUE, 1, "1"), event_edge = c("rising", "change", "active"), pre_window_ms = 1000, post_window_ms = 5000, pre_window_samples = NULL, post_window_samples = NULL, collapse_nearby_ms = 0, require_valid_ttl = TRUE )
data |
A data frame containing biometric samples. |
ttl_cols |
Optional TTL marker columns. If |
event_col |
Optional single user-specified event column. If supplied, it is used instead of automatic TTL-column detection. |
ttl_valid_col |
Optional TTL validity column. If |
time_col |
Optional time column. If |
sample_col |
Optional sample/counter column. If |
group_cols |
Optional grouping columns. If |
participant_col, stimulus_col, trial_col
|
Optional explicit grouping
columns to add to |
event_value |
Optional value(s) that define an active event. If |
valid_values |
Values treated as valid in the TTL validity column. |
event_edge |
Event-detection rule. |
pre_window_ms, post_window_ms
|
Event window in milliseconds when a usable time column is available. |
pre_window_samples, post_window_samples
|
Event window in samples when no usable time column is available. If omitted, only the event sample is kept. |
collapse_nearby_ms |
Optional minimum distance between retained events within a group, in milliseconds. |
require_valid_ttl |
If |
A list with overview, events, aligned_data, and settings.
Estimates offset or linear drift between a reference stream and a target stream using matched event times, then adds an aligned reference-clock time column to the target stream.
align_gazepoint_streams_by_events( reference, target, reference_events, target_events, reference_time_col = NULL, target_time_col = NULL, reference_event_time_col = NULL, target_event_time_col = NULL, event_id_col = NULL, method = c("linear", "offset"), include_streams = TRUE )align_gazepoint_streams_by_events( reference, target, reference_events, target_events, reference_time_col = NULL, target_time_col = NULL, reference_event_time_col = NULL, target_event_time_col = NULL, event_id_col = NULL, method = c("linear", "offset"), include_streams = TRUE )
reference |
Reference data frame. |
target |
Target data frame to align to the reference clock. |
reference_events |
Reference event table or numeric event times. |
target_events |
Target event table or numeric event times. |
reference_time_col |
Reference stream time column. |
target_time_col |
Target stream time column. |
reference_event_time_col |
Optional reference-event time column. |
target_event_time_col |
Optional target-event time column. |
event_id_col |
Optional event identifier column used for matching. |
method |
|
include_streams |
If TRUE, include reference and aligned target streams in the returned object. |
Object of class gazepoint_stream_alignment.
Estimates a constant offset or linear offset-plus-drift mapping from matched Gazepoint and EEG events, then applies that mapping to a Gazepoint stream.
align_gazepoint_to_eeg( gazepoint, gazepoint_events, eeg_events, gazepoint_time_col = NULL, gazepoint_event_time_col = NULL, eeg_event_time_col = NULL, eeg_event_sample_col = NULL, gazepoint_event_id_col = NULL, eeg_event_id_col = NULL, gazepoint_time_unit = c("auto", "seconds", "milliseconds", "samples"), eeg_time_unit = c("auto", "seconds", "milliseconds", "samples"), eeg_sampling_rate_hz = NULL, method = c("offset", "linear"), match_by = c("auto", "id", "row"), robust = TRUE, maximum_residual_s = NULL, residual_action = c("error", "allow"), output_col = "time_eeg_s" )align_gazepoint_to_eeg( gazepoint, gazepoint_events, eeg_events, gazepoint_time_col = NULL, gazepoint_event_time_col = NULL, eeg_event_time_col = NULL, eeg_event_sample_col = NULL, gazepoint_event_id_col = NULL, eeg_event_id_col = NULL, gazepoint_time_unit = c("auto", "seconds", "milliseconds", "samples"), eeg_time_unit = c("auto", "seconds", "milliseconds", "samples"), eeg_sampling_rate_hz = NULL, method = c("offset", "linear"), match_by = c("auto", "id", "row"), robust = TRUE, maximum_residual_s = NULL, residual_action = c("error", "allow"), output_col = "time_eeg_s" )
gazepoint |
Gazepoint sample-level data. |
gazepoint_events |
Gazepoint event table or numeric times. |
eeg_events |
EEG event table or numeric times. |
gazepoint_time_col |
Gazepoint stream time column. |
gazepoint_event_time_col |
Gazepoint event-time column. |
eeg_event_time_col |
EEG event-time column. |
eeg_event_sample_col |
Optional EEG event-sample column. |
gazepoint_event_id_col |
Optional Gazepoint event identifier. |
eeg_event_id_col |
Optional EEG event identifier. |
gazepoint_time_unit |
Gazepoint time unit. |
eeg_time_unit |
EEG event-time unit. |
eeg_sampling_rate_hz |
Required when EEG events are sample numbers. |
method |
|
match_by |
Match events by identifier or row order. |
robust |
Use one MAD-based residual refit for linear alignment. |
maximum_residual_s |
Optional maximum permitted absolute residual. |
residual_action |
Handling when the residual threshold is exceeded. |
output_col |
Added aligned-time column. |
A "gazepoint_eeg_alignment" object.
Computes summaries for specialised alternating-current EDA recordings. This
function is for true AC admittance/susceptance data, not ordinary DC
skin-conductance columns such as GSR_US.
analyze_gazepoint_ac_susceptance( dat, conductance_col = NULL, susceptance_col = NULL, admittance_col = NULL, phase_col = NULL, frequency_col = NULL, time_col = NULL, group_cols = NULL )analyze_gazepoint_ac_susceptance( dat, conductance_col = NULL, susceptance_col = NULL, admittance_col = NULL, phase_col = NULL, frequency_col = NULL, time_col = NULL, group_cols = NULL )
dat |
A data frame. |
conductance_col |
Optional real conductance component column. |
susceptance_col |
Optional imaginary susceptance component column. |
admittance_col |
Optional admittance magnitude column. |
phase_col |
Optional phase angle column. |
frequency_col |
Optional AC frequency column. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
A list with overview, timeseries, summary, and settings.
Computes dependency-light linear Granger-style directionality tests between a respiration proxy and heart-rate or IBI/RR signal. This estimates predictive directionality in a VAR-style model. It does not prove physiological causality from observational data by itself.
analyze_gazepoint_cardiorespiratory_causality( dat, respiration_col, cardiac_col, time_col = NULL, group_cols = NULL, lag_order = 3, min_rows = 30, standardise = TRUE )analyze_gazepoint_cardiorespiratory_causality( dat, respiration_col, cardiac_col, time_col = NULL, group_cols = NULL, lag_order = 3, min_rows = 30, standardise = TRUE )
dat |
A data frame. |
respiration_col |
Numeric respiration proxy column. |
cardiac_col |
Numeric cardiac column, such as HR, IBI, or RR. |
time_col |
Optional time column for ordering. |
group_cols |
Optional grouping columns. |
lag_order |
VAR lag order. |
min_rows |
Minimum complete rows per group. |
standardise |
Logical. If |
A list with overview, causality_summary, and settings.
Computes skin-potential level and skin-potential response descriptors from a voltage-like skin-potential column. This is for endosomatic skin-potential recordings, not standard exosomatic skin conductance.
analyze_gazepoint_skin_potential( dat, sp_col, time_col, group_cols = NULL, response_direction = c("both", "positive", "negative"), response_threshold = NULL, min_response_distance_s = 1 )analyze_gazepoint_skin_potential( dat, sp_col, time_col, group_cols = NULL, response_direction = c("both", "positive", "negative"), response_threshold = NULL, min_response_distance_s = 1 )
dat |
A data frame. |
sp_col |
Numeric skin-potential column, usually in millivolts. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns. |
response_direction |
|
response_threshold |
Optional absolute threshold for response detection.
If |
min_response_distance_s |
Minimum distance between detected responses. |
A list with overview, level_summary, response_table,
timeseries, and settings.
Replaces selected identifier columns with deterministic sequential codes. This function supports de-identification workflows, but it does not by itself guarantee anonymity or regulatory compliance.
anonymize_gazepoint_data( data, id_cols, prefix = "P", width = 3, keep_mapping = TRUE )anonymize_gazepoint_data( data, id_cols, prefix = "P", width = 3, keep_mapping = TRUE )
data |
A data frame. |
id_cols |
Character vector of identifier columns to replace. |
prefix |
Prefix used in generated codes. |
width |
Numeric width used for zero-padded codes. |
keep_mapping |
Logical. If |
A data frame with class gazepoint_anonymized_data.
Validates expected columns and either throws an error, raises a warning, or returns a summary table.
assert_gazepoint_columns( data, required, optional = character(), mode = c("error", "warning", "summary"), ignore_case = TRUE )assert_gazepoint_columns( data, required, optional = character(), mode = c("error", "warning", "summary"), ignore_case = TRUE )
data |
Data frame. |
required |
Character vector of required columns. |
optional |
Character vector of optional columns. |
mode |
|
ignore_case |
If TRUE, match columns case-insensitively. |
Invisibly TRUE for passing checks, or a summary data frame when
mode = "summary".
Computes descriptive quality-control summaries for a Gazepoint HRP/PPG waveform column. The output is intended for waveform availability, missingness, flatness, and timing-gap review. It does not infer diagnosis, emotion, valence, cognition, preference, or true physiological state.
assess_gazepoint_hrp_waveform_quality( data, hrp_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate = NULL, time_unit = c("auto", "ms", "seconds", "samples"), min_rows = 20, min_finite_prop = 0.8, max_flat_prop = 0.95, flat_tolerance = 1e-08, max_gap_multiplier = 3 )assess_gazepoint_hrp_waveform_quality( data, hrp_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate = NULL, time_unit = c("auto", "ms", "seconds", "samples"), min_rows = 20, min_finite_prop = 0.8, max_flat_prop = 0.95, flat_tolerance = 1e-08, max_gap_multiplier = 3 )
data |
A Gazepoint biometric data frame or a list containing one. |
hrp_col |
Optional HRP/PPG waveform column. If |
time_col |
Optional time, timestamp, or sample-counter column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Optional sampling rate in Hz. |
time_unit |
Unit of |
min_rows |
Minimum rows required per group. |
min_finite_prop |
Minimum finite waveform proportion required per group. |
max_flat_prop |
Maximum allowed proportion of near-zero consecutive differences among finite waveform values. |
flat_tolerance |
Absolute difference threshold used to identify near-flat consecutive waveform changes. |
max_gap_multiplier |
Time gaps larger than this multiple of the median positive time step are flagged. |
A list with overview, group_quality, row_flags, and settings.
Summarizes median sample interval, effective sampling rate, jitter, repeated timestamps, negative steps, and large gaps overall or by group.
assess_gazepoint_sampling_irregularity( data, time_col = NULL, group_cols = NULL, nominal_rate_hz = NULL, large_gap_factor = 3 )assess_gazepoint_sampling_irregularity( data, time_col = NULL, group_cols = NULL, nominal_rate_hz = NULL, large_gap_factor = 3 )
data |
Data frame or numeric time vector. |
time_col |
Time column for data-frame input. |
group_cols |
Optional grouping columns. |
nominal_rate_hz |
Optional expected sampling rate. |
large_gap_factor |
Gap threshold relative to median interval. |
Data frame with one row per group.
Assigns sample-level gaze coordinates or fixation centroids to rectangular or polygonal areas of interest (AOIs). The original rows are preserved and augmented with an AOI label, match count, ambiguity flag, and assignment status.
assign_gazepoint_aoi( data, aois, x_col = NULL, y_col = NULL, aoi_label_col = "aoi", format = c("auto", "rectangle", "polygon"), aoi_id_col = NULL, data_match_cols = NULL, aoi_match_cols = data_match_cols, xmin_col = "xmin", xmax_col = "xmax", ymin_col = "ymin", ymax_col = "ymax", vertex_x_col = "vertex_x", vertex_y_col = "vertex_y", priority_col = NULL, overlap = c("priority", "first", "smallest", "all", "error"), boundary = c("inside", "outside"), output_col = "AOI", match_count_col = "aoi_match_count", ambiguous_col = "aoi_ambiguous", status_col = "aoi_assignment_status", all_separator = "|", overwrite = FALSE )assign_gazepoint_aoi( data, aois, x_col = NULL, y_col = NULL, aoi_label_col = "aoi", format = c("auto", "rectangle", "polygon"), aoi_id_col = NULL, data_match_cols = NULL, aoi_match_cols = data_match_cols, xmin_col = "xmin", xmax_col = "xmax", ymin_col = "ymin", ymax_col = "ymax", vertex_x_col = "vertex_x", vertex_y_col = "vertex_y", priority_col = NULL, overlap = c("priority", "first", "smallest", "all", "error"), boundary = c("inside", "outside"), output_col = "AOI", match_count_col = "aoi_match_count", ambiguous_col = "aoi_ambiguous", status_col = "aoi_assignment_status", all_separator = "|", overwrite = FALSE )
data |
A data frame containing gaze coordinates or fixation centroids. |
aois |
A data frame containing rectangular or polygonal AOI definitions. |
x_col |
Numeric horizontal-coordinate column in |
y_col |
Numeric vertical-coordinate column in |
aoi_label_col |
AOI label column in |
format |
AOI-definition format: |
aoi_id_col |
Optional AOI identifier column. For polygon definitions, this distinguishes multiple polygons with the same label. |
data_match_cols |
Optional columns in |
aoi_match_cols |
Corresponding columns in |
xmin_col, xmax_col, ymin_col, ymax_col
|
Rectangle-boundary columns. |
vertex_x_col, vertex_y_col
|
Polygon-vertex columns. |
priority_col |
Optional numeric priority column. Smaller values receive
higher priority when |
overlap |
Rule for coordinates falling within multiple AOIs:
|
boundary |
Should coordinates on AOI boundaries be treated as
|
output_col |
Name of the generated AOI-label column. |
match_count_col |
Name of the generated AOI-match-count column. |
ambiguous_col |
Name of the generated logical ambiguity column. |
status_col |
Name of the generated assignment-status column. |
all_separator |
Separator used when |
overwrite |
Logical. If |
Rectangular AOIs use one row per definition with minimum and maximum x and y coordinates. Polygon AOIs use long-format vertices, with one row per vertex and repeated AOI identifiers or labels.
Optional matching columns can restrict AOIs to particular trials, screens, media items, stimuli, or other recording contexts. Missing or blank values in AOI matching columns act as wildcards.
Supported assignment statuses are:
"matched": exactly one AOI matched;
"ambiguous_resolved": multiple AOIs matched and one was selected;
"ambiguous_all": all matching labels were retained;
"unmatched": valid coordinates did not fall within an eligible AOI;
"invalid_coordinate": x or y was missing or non-finite.
Coordinate systems are not transformed. Gaze coordinates and AOI definitions must therefore use the same scale, orientation, and origin.
A data frame with class "gazepoint_aoi_assignment". Attributes
aoi_assignment_log, aoi_assignment_settings, and aoi_definitions
contain structured provenance information.
summarize_gazepoint_fixations(),
summarize_gazepoint_aoi_dwell(),
summarise_gazepoint_aoi_biometrics()
gaze <- data.frame( gaze_x = c(0.1, 0.5, 0.9), gaze_y = c(0.5, 0.5, 0.5) ) rectangles <- data.frame( aoi = c("left", "right"), xmin = c(0, 0.6), xmax = c(0.4, 1), ymin = c(0, 0), ymax = c(1, 1) ) assign_gazepoint_aoi( gaze, rectangles, x_col = "gaze_x", y_col = "gaze_y" )gaze <- data.frame( gaze_x = c(0.1, 0.5, 0.9), gaze_y = c(0.5, 0.5, 0.5) ) rectangles <- data.frame( aoi = c("left", "right"), xmin = c(0, 0.6), xmax = c(0.4, 1), ymin = c(0, 0), ymax = c(1, 1) ) assign_gazepoint_aoi( gaze, rectangles, x_col = "gaze_x", y_col = "gaze_y" )
Flags short, long, non-finite, duplicate-time, and abrupt-change intervals in beat or inter-beat-interval data. The function is intended for quality control and audit reporting only. It does not remove beats, modify data, or make physiological, psychological, diagnostic, or clinical claims.
audit_gazepoint_beats( data, ibi_col = NULL, beat_time_col = NULL, group_cols = NULL, min_ibi = 300, max_ibi = 2000, duplicate_tolerance = 0, max_relative_change = NULL )audit_gazepoint_beats( data, ibi_col = NULL, beat_time_col = NULL, group_cols = NULL, min_ibi = 300, max_ibi = 2000, duplicate_tolerance = 0, max_relative_change = NULL )
data |
A data frame. |
ibi_col |
Optional numeric inter-beat-interval column. If omitted,
intervals are derived from |
beat_time_col |
Optional numeric beat-time column. Required when
|
group_cols |
Optional character vector of grouping columns, such as participant, session, trial, or condition. |
min_ibi |
Minimum plausible interval, in the same units as the IBI column or beat-time column. |
max_ibi |
Maximum plausible interval, in the same units as the IBI column or beat-time column. |
duplicate_tolerance |
Maximum adjacent beat-time difference treated as a
duplicate-time flag. Ignored when |
max_relative_change |
Optional relative-change threshold for flagging
abrupt adjacent IBI changes. If |
A list with class gazepoint_beat_audit, containing beat-level
flags, group summaries, and parameters.
Summarises missingness and zero values for Gazepoint biometric columns. This is useful because Gazepoint exports may contain biometric columns even when a channel was inactive or invalid during recording.
audit_gazepoint_biometric_missingness(data, columns = NULL)audit_gazepoint_biometric_missingness(data, columns = NULL)
data |
A data frame or a path to a Gazepoint CSV export. |
columns |
Optional character vector of columns to audit. If |
A data frame with one row per audited column.
Audits timing or row-order information in Gazepoint Biometrics exports. The
function checks monotonicity, duplicate timestamps, nonpositive intervals,
and estimated sampling rate when the selected time column has a real time
unit. If only CNT is available, the function can still check ordering but
does not estimate a sampling rate unless time_unit is explicitly meaningful.
audit_gazepoint_biometric_sampling( data, group_columns = NULL, time_column = NULL, time_unit = c("seconds", "milliseconds", "microseconds", "samples"), expected_rate_hz = 60, tolerance_hz = 5 )audit_gazepoint_biometric_sampling( data, group_columns = NULL, time_column = NULL, time_unit = c("seconds", "milliseconds", "microseconds", "samples"), expected_rate_hz = 60, tolerance_hz = 5 )
data |
A data frame or a path to a Gazepoint CSV export. |
group_columns |
Optional grouping columns within which timing should be
audited, such as |
time_column |
Optional time/order column. If |
time_unit |
Unit of the selected time column. Use |
expected_rate_hz |
Optional expected sampling rate in Hz. |
tolerance_hz |
Acceptable absolute deviation from |
A data frame with one row per group.
Combines time-order/reset diagnostics with conservative signal-lag summaries across signal pairs and groups. The helper is intended for quality control and synchronization review. It does not infer emotional valence, cognitive states, causal timing, or true physiological latency.
audit_gazepoint_biometric_sync_drift( data, time_col = NULL, group_cols = NULL, signal_pairs = NULL, signal_cols = NULL, reference_signal_col = NULL, max_lag = 1000, lag_step = NULL, drift_tolerance = NULL, method = c("pearson", "spearman"), min_complete_pairs = 20, use_first_difference = FALSE, include_reset_segments = TRUE )audit_gazepoint_biometric_sync_drift( data, time_col = NULL, group_cols = NULL, signal_pairs = NULL, signal_cols = NULL, reference_signal_col = NULL, max_lag = 1000, lag_step = NULL, drift_tolerance = NULL, method = c("pearson", "spearman"), min_complete_pairs = 20, use_first_difference = FALSE, include_reset_segments = TRUE )
data |
A Gazepoint biometric data frame. |
time_col |
Optional time or counter column. |
group_cols |
Optional grouping columns. |
signal_pairs |
Optional two-column data frame, matrix, or list defining
signal pairs. If |
signal_cols |
Optional candidate signal columns used when |
reference_signal_col |
Optional reference signal used when |
max_lag |
Maximum absolute lag to evaluate, in the same units as
|
lag_step |
Step size between candidate lags. If |
drift_tolerance |
Optional threshold for the range of estimated lags
across groups. If |
method |
Correlation method passed to |
min_complete_pairs |
Minimum complete aligned observations required for each candidate lag. |
use_first_difference |
If |
include_reset_segments |
If |
A list with overview, checks, time_reset_audit,
lag_by_group, lag_profile, drift_summary, and settings.
Provides a single front-door preflight audit for a Gazepoint-style biometric export. The audit standardizes column names when requested, reports likely modality availability, schema status, timestamp irregularity, missingness, duplicate rows, and reviewer-facing warnings.
audit_gazepoint_biometrics_file( path = NULL, data = NULL, expected_modalities = c("time", "eda", "ppg", "hr", "ibi", "pupil", "gaze", "events"), time_col = NULL, standardize = TRUE, include_data = FALSE, long_gap_s = NULL ) ## S3 method for class 'gazepoint_biometrics_audit' print(x, ...) ## S3 method for class 'gazepoint_biometrics_audit' summary(object, ...)audit_gazepoint_biometrics_file( path = NULL, data = NULL, expected_modalities = c("time", "eda", "ppg", "hr", "ibi", "pupil", "gaze", "events"), time_col = NULL, standardize = TRUE, include_data = FALSE, long_gap_s = NULL ) ## S3 method for class 'gazepoint_biometrics_audit' print(x, ...) ## S3 method for class 'gazepoint_biometrics_audit' summary(object, ...)
path |
Optional CSV/TSV file path. |
data |
Optional data frame. If supplied, it is used instead of |
expected_modalities |
Modalities expected in the export. |
time_col |
Optional time column. If omitted, a common Gazepoint time column is guessed after optional standardization. |
standardize |
If TRUE, apply |
include_data |
If TRUE, include the standardized data in the returned audit object. |
long_gap_s |
Optional missing-gap threshold passed to
|
x |
Object of class |
... |
Additional arguments currently ignored. |
object |
Object of class |
An object of class gazepoint_biometrics_audit.
Summarise condition balance across participants and trials before modelling, event-window summaries, or two-condition time-course workflows.
audit_gazepoint_condition_balance( data, participant_col, condition_col, trial_col = NULL, expected_conditions = NULL )audit_gazepoint_condition_balance( data, participant_col, condition_col, trial_col = NULL, expected_conditions = NULL )
data |
A data frame containing trial-, event-, or sample-level records. |
participant_col |
Name of the participant identifier column. |
condition_col |
Name of the condition column. |
trial_col |
Optional trial identifier column. |
expected_conditions |
Optional character vector of expected conditions. |
A list with class "gazepoint_condition_balance_audit".
Checks a dataset or export folder for expected directories, files, filename patterns, duplicate names, empty files, and optional sidecar coverage. This is a lightweight structure audit, not a full BIDS validator or converter.
audit_gazepoint_dataset_structure( root, expected_dirs = NULL, expected_files = NULL, expected_patterns = NULL, allowed_extensions = c("csv", "tsv", "txt", "json", "xlsx", "rds"), require_sidecars = FALSE, recursive = TRUE, include_hidden = FALSE )audit_gazepoint_dataset_structure( root, expected_dirs = NULL, expected_files = NULL, expected_patterns = NULL, allowed_extensions = c("csv", "tsv", "txt", "json", "xlsx", "rds"), require_sidecars = FALSE, recursive = TRUE, include_hidden = FALSE )
root |
Dataset or export root directory. |
expected_dirs |
Optional character vector of directory paths expected
under |
expected_files |
Optional character vector of file paths expected under
|
expected_patterns |
Optional named or unnamed character vector of regular expressions that should match at least one relative file path. |
allowed_extensions |
Optional character vector of allowed file extensions, without leading dots. |
require_sidecars |
Logical. If |
recursive |
Logical. If |
|
Logical. If |
A list with class gazepoint_dataset_structure_audit.
Compares signal distributions across sessions/blocks using baseline-vs-current differences, Kolmogorov-Smirnov tests, and Population Stability Index (PSI).
audit_gazepoint_distributional_drift( dat, signal_cols, session_col = "session", participant_col = NULL, reference_session = NULL, bins = 10, psi_warn = 0.1, psi_fail = 0.25 )audit_gazepoint_distributional_drift( dat, signal_cols, session_col = "session", participant_col = NULL, reference_session = NULL, bins = 10, psi_warn = 0.1, psi_fail = 0.25 )
dat |
A data frame containing longitudinal biometric data. |
signal_cols |
Numeric signal columns to audit. |
session_col |
Session/block/timepoint column. |
participant_col |
Optional participant column. |
reference_session |
Optional reference session. If |
bins |
Number of bins for PSI. |
psi_warn |
PSI threshold for warning. |
psi_fail |
PSI threshold for failure. |
A list with overview, drift_summary, and settings.
Flags row-level artifacts in Gazepoint electrodermal activity signals,
preferring GSR_US conductance when available. The helper detects abrupt
jumps, abrupt slopes, flatline runs, zero runs, negative conductance values,
and optional out-of-range values. It is a conservative preprocessing/QC
helper and does not interpret EDA as emotional valence.
audit_gazepoint_eda_artifacts( data, signal_col = NULL, time_col = NULL, group_cols = NULL, prefer_gsr_us = TRUE, jump_threshold_sd = 6, slope_threshold_sd = 6, flat_run_length = 20, zero_run_length = 20, saturation_min = NULL, saturation_max = NULL, negative_allowed = NULL )audit_gazepoint_eda_artifacts( data, signal_col = NULL, time_col = NULL, group_cols = NULL, prefer_gsr_us = TRUE, jump_threshold_sd = 6, slope_threshold_sd = 6, flat_run_length = 20, zero_run_length = 20, saturation_min = NULL, saturation_max = NULL, negative_allowed = NULL )
data |
A data frame containing Gazepoint biometric rows. |
signal_col |
Optional EDA/GSR signal column. If |
time_col |
Optional time/counter column. If |
group_cols |
Optional grouping columns. If |
prefer_gsr_us |
Logical. If |
jump_threshold_sd |
Robust z threshold for absolute signal jumps. |
slope_threshold_sd |
Robust z threshold for absolute signal slopes. |
flat_run_length |
Minimum repeated-value run length flagged as flatline. |
zero_run_length |
Minimum zero-value run length flagged as zero run. |
saturation_min |
Optional lower bound for acceptable signal values. |
saturation_max |
Optional upper bound for acceptable signal values. |
negative_allowed |
Optional logical. If |
A list with overview, row_flags, artifact_runs,
group_summary, and settings.
Audits Gazepoint engagement-dial values for missingness, inactive rows, validity flags, plausible range, flatlining, and usable sample coverage.
audit_gazepoint_engagement_dial( data, value_column = "DIAL", validity_column = "DIALV", min_value = 0, max_value = 1, jump_threshold = NULL )audit_gazepoint_engagement_dial( data, value_column = "DIAL", validity_column = "DIALV", min_value = 0, max_value = 1, jump_threshold = NULL )
data |
A data frame or a path to a Gazepoint CSV export. |
value_column |
Engagement-dial value column. Defaults to |
validity_column |
Engagement-dial validity column. Defaults to
|
min_value |
Minimum plausible dial value. |
max_value |
Maximum plausible dial value. |
jump_threshold |
Optional threshold for detecting large sample-to-sample jumps. |
A one-row data frame summarising signal quality.
Check whether expected events, TTL markers, AOI events, or task events are present across participant/trial/condition units.
audit_gazepoint_event_coverage( data, event_col, participant_col = NULL, trial_col = NULL, condition_col = NULL, expected_events = NULL, unit_cols = NULL )audit_gazepoint_event_coverage( data, event_col, participant_col = NULL, trial_col = NULL, condition_col = NULL, expected_events = NULL, unit_cols = NULL )
data |
A data frame containing event-, trial-, or sample-level records. |
event_col |
Name of the event/marker column. |
participant_col |
Optional participant identifier column. |
trial_col |
Optional trial identifier column. |
condition_col |
Optional condition column. |
expected_events |
Optional character vector of expected event labels. |
unit_cols |
Optional character vector of columns defining event-coverage
units. If supplied, this overrides |
A list with class "gazepoint_event_coverage_audit".
Check whether an imported or prepared Gazepoint workflow table contains the expected participant, trial, condition, and optional session structure before modelling, event-locking, or time-course analysis.
audit_gazepoint_experiment_design( data, participant_col, trial_col = NULL, condition_col = NULL, session_col = NULL, expected_conditions = NULL, min_trials_per_condition = 1L )audit_gazepoint_experiment_design( data, participant_col, trial_col = NULL, condition_col = NULL, session_col = NULL, expected_conditions = NULL, min_trials_per_condition = 1L )
data |
A data frame containing trial-, event-, or sample-level records. |
participant_col |
Name of the participant identifier column. |
trial_col |
Optional name of the trial identifier column. |
condition_col |
Optional name of the condition column. |
session_col |
Optional name of the session/block column. |
expected_conditions |
Optional character vector of expected conditions. |
min_trials_per_condition |
Minimum acceptable number of trials per
participant-condition cell when |
A list with class "gazepoint_experiment_design_audit".
dat <- data.frame( participant = rep(paste0("P", 1:4), each = 4), trial = rep(1:4, times = 4), condition = rep(c("A", "B"), times = 8) ) audit_gazepoint_experiment_design( dat, participant_col = "participant", trial_col = "trial", condition_col = "condition", expected_conditions = c("A", "B") )dat <- data.frame( participant = rep(paste0("P", 1:4), each = 4), trial = rep(1:4, times = 4), condition = rep(c("A", "B"), times = 8) ) audit_gazepoint_experiment_design( dat, participant_col = "participant", trial_col = "trial", condition_col = "condition", expected_conditions = c("A", "B") )
Reports whether expected Gazepoint-style roles are present, missing, or
ambiguous, using the same alias dictionary as
standardize_gazepoint_column_names().
audit_gazepoint_export_schema( data, expected_roles = NULL, dictionary = NULL, strict = FALSE )audit_gazepoint_export_schema( data, expected_roles = NULL, dictionary = NULL, strict = FALSE )
data |
Data frame or CSV/TSV path. |
expected_roles |
Optional character vector of expected canonical roles. |
dictionary |
Optional alias dictionary. |
strict |
If TRUE, error when required roles are missing. |
Data frame with one row per expected role.
Audits Gazepoint GSR/EDA columns for missingness, inactive zero rows,
validity flags, plausible value ranges, flatlining, and usable sample
coverage. When available, GSR_US is used by default because it represents
skin conductance in microsiemens in Gazepoint exports.
audit_gazepoint_gsr_quality( data, value_column = NULL, validity_column = "GSRV", min_value = 0, max_value = 100, jump_threshold = NULL )audit_gazepoint_gsr_quality( data, value_column = NULL, validity_column = "GSRV", min_value = 0, max_value = 100, jump_threshold = NULL )
data |
A data frame or a path to a Gazepoint CSV export. |
value_column |
Optional GSR/EDA value column. If |
validity_column |
Optional validity column. Defaults to |
min_value |
Minimum plausible value. |
max_value |
Maximum plausible value. |
jump_threshold |
Optional threshold for detecting large sample-to-sample jumps. |
A one-row data frame summarising signal quality.
Checks whether a Gazepoint GSR/EDA column looks more like conductance in microSiemens or resistance/impedance-like values in Ohms. This is a preprocessing safety audit, not a definitive device calibration test.
audit_gazepoint_gsr_units( dat, gsr_col = "GSR", convert = FALSE, output_col = NULL, resistance_to_us_factor = 1e+06 )audit_gazepoint_gsr_units( dat, gsr_col = "GSR", convert = FALSE, output_col = NULL, resistance_to_us_factor = 1e+06 )
dat |
A data frame. |
gsr_col |
Name of the GSR/EDA column to audit. |
convert |
Logical. If |
output_col |
Output column used when |
resistance_to_us_factor |
Conversion factor. For Ohms to microSiemens,
use |
A list with overview, diagnostics, recommendation, and,
when requested, data.
Audits Gazepoint heart-rate values for missingness, inactive zero rows,
validity flags, plausible value ranges, sudden jumps, flatlining, and usable
sample coverage. HRV is treated as the heart-rate validity flag, not as a
heart-rate-variability metric.
audit_gazepoint_hr_quality( data, value_column = "HR", validity_column = "HRV", min_value = 30, max_value = 220, jump_threshold = 25 )audit_gazepoint_hr_quality( data, value_column = "HR", validity_column = "HRV", min_value = 30, max_value = 220, jump_threshold = 25 )
data |
A data frame or a path to a Gazepoint CSV export. |
value_column |
Heart-rate value column. Defaults to |
validity_column |
Heart-rate validity column. Defaults to |
min_value |
Minimum plausible heart rate. |
max_value |
Maximum plausible heart rate. |
jump_threshold |
Threshold for detecting large sample-to-sample jumps. |
A one-row data frame summarising signal quality.
Audits inter-beat interval (IBI) or RR-interval values in Gazepoint
Biometrics-style exports. This helper deliberately does not use raw HRV
columns as HRV metrics. HRV-style summaries should be derived only from
genuine IBI/RR interval columns.
audit_gazepoint_ibi_quality( data, ibi_col = NULL, group_cols = NULL, time_col = NULL, unit = c("auto", "milliseconds", "seconds"), min_ibi_ms = 300, max_ibi_ms = 2000, max_jump_ms = 500 )audit_gazepoint_ibi_quality( data, ibi_col = NULL, group_cols = NULL, time_col = NULL, unit = c("auto", "milliseconds", "seconds"), min_ibi_ms = 300, max_ibi_ms = 2000, max_jump_ms = 500 )
data |
A data frame. |
ibi_col |
Optional IBI/RR interval column. If |
group_cols |
Optional grouping columns, such as participant, trial, stimulus, condition, or window labels. |
time_col |
Optional time/order column used to order samples before successive-difference checks. |
unit |
Unit of the IBI values. |
min_ibi_ms |
Minimum plausible IBI in milliseconds. |
max_ibi_ms |
Maximum plausible IBI in milliseconds. |
max_jump_ms |
Maximum plausible absolute change between successive IBI values within a group. |
A list with overview, samples, group_summary, and settings.
df <- data.frame( USER = rep(c("P1", "P2"), each = 4), IBI = c(800, 810, 790, 805, 900, 910, 905, 920) ) audit_gazepoint_ibi_quality(df, group_cols = "USER")df <- data.frame( USER = rep(c("P1", "P2"), each = 4), IBI = c(800, 810, 790, 805, 900, 910, 905, 920) ) audit_gazepoint_ibi_quality(df, group_cols = "USER")
Checks whether declared bridge functions are exported and records the installed versions of optional R and Python dependencies. Missing optional dependencies are recorded for review rather than treated as core-package failures.
audit_gazepoint_interoperability_versions( manifest = gazepoint_interoperability_manifest(), include_python = TRUE, strict = FALSE )audit_gazepoint_interoperability_versions( manifest = gazepoint_interoperability_manifest(), include_python = TRUE, strict = FALSE )
manifest |
Interoperability manifest. Defaults to
|
include_python |
Logical. Inspect the active Python environment through
the optional |
strict |
Logical. Stop when a required contract fails, a declared bridge function is missing, or an installed dependency is below its minimum tested version. |
Python package versions are queried through importlib.metadata; target
modules are not imported merely to determine their versions.
An object of class "gazepoint_interoperability_audit" containing:
results: target-level compatibility findings;
summary: aggregate pass and review counts;
session: R, Python, operating-system, package, and timestamp metadata;
manifest: the manifest used for the audit.
audit <- audit_gazepoint_interoperability_versions( include_python = FALSE ) audit$summaryaudit <- audit_gazepoint_interoperability_versions( include_python = FALSE ) audit$summary
Checks a pipeline map for missing expected steps, duplicate step identifiers, edge references to missing nodes, and simple ordering violations. The audit is descriptive and does not evaluate whether a scientific analysis is valid.
audit_gazepoint_pipeline_steps( pipeline, expected_steps = NULL, required_order = NULL, allow_extra = TRUE )audit_gazepoint_pipeline_steps( pipeline, expected_steps = NULL, required_order = NULL, allow_extra = TRUE )
pipeline |
A |
expected_steps |
Optional character vector of step identifiers expected
in the pipeline. If |
required_order |
Optional character vector describing the expected order
of selected steps. If |
allow_extra |
Logical. If |
A list with class gazepoint_pipeline_audit.
Checks whether a preregistration checklist has corresponding evidence objects and whether those evidence objects contain expected fields. The audit is a documentation-readiness check only; it does not judge study quality or perform automatic exclusion.
audit_gazepoint_preregistration_consistency( checklist = NULL, evidence = list(), require_required_fields = TRUE )audit_gazepoint_preregistration_consistency( checklist = NULL, evidence = list(), require_required_fields = TRUE )
checklist |
A checklist produced by
|
evidence |
A named list of evidence objects. Each checklist row uses
|
require_required_fields |
Logical. If |
A list with class gazepoint_preregistration_audit.
Computes correlations between pupil size and luminance/brightness and flags groups where the absolute association exceeds a threshold.
audit_gazepoint_pupil_luminance( data, pupil_col = NULL, luminance_col = NULL, group_cols = NULL, threshold = 0.3, method = c("pearson", "spearman") )audit_gazepoint_pupil_luminance( data, pupil_col = NULL, luminance_col = NULL, group_cols = NULL, threshold = 0.3, method = c("pearson", "spearman") )
data |
Data frame containing pupil and luminance columns. |
pupil_col |
Pupil column. |
luminance_col |
Luminance/brightness column. |
group_cols |
Optional grouping columns. |
threshold |
Absolute correlation threshold for flagging. |
method |
Correlation method. |
Data frame with correlation and flag columns.
Performs conservative package-level checks for release preparation. The audit inspects package files, exported functions, manual pages, tests, pkgdown reference pages, vignettes/articles, and optional roadmap terms. It does not inspect participant-level data and does not make biometric, psychological, clinical, or diagnostic interpretations.
audit_gazepoint_release_readiness( path = ".", required_files = c("DESCRIPTION", "NAMESPACE", "R", "man", "tests/testthat", "_pkgdown.yml"), expected_exports = NULL, roadmap_terms = NULL, require_pkgdown = TRUE )audit_gazepoint_release_readiness( path = ".", required_files = c("DESCRIPTION", "NAMESPACE", "R", "man", "tests/testthat", "_pkgdown.yml"), expected_exports = NULL, roadmap_terms = NULL, require_pkgdown = TRUE )
path |
Package root. |
required_files |
Character vector of required package paths. |
expected_exports |
Optional character vector of exported function names
expected to be present in |
roadmap_terms |
Optional character vector of roadmap terms or helper names to check across R files, tests, documentation, and pkgdown output. |
require_pkgdown |
Logical. If |
A list with checks, overview, exports, feature coverage, release
checklist, and settings. The object has class
gazepoint_release_readiness_audit.
Aggregates selected QC metrics by session, participant, trial, or another grouping unit, then flags unusual values using transparent z-score and/or IQR rules. The function is intended for audit reporting only and does not imply automatic exclusion.
audit_gazepoint_session_comparability( data, metric_cols, group_cols = NULL, method = c("both", "z", "iqr"), z_threshold = 2, iqr_multiplier = 1.5 )audit_gazepoint_session_comparability( data, metric_cols, group_cols = NULL, method = c("both", "z", "iqr"), z_threshold = 2, iqr_multiplier = 1.5 )
data |
A data frame. |
metric_cols |
Character vector of numeric QC metric columns. |
group_cols |
Optional character vector defining the session or analysis unit to compare. |
method |
Outlier rule: |
z_threshold |
Absolute z-score threshold. |
iqr_multiplier |
IQR multiplier used for Tukey-style fences. |
A list with class gazepoint_session_comparability_audit.
Screens biometric signal columns for missingness, all-zero channels, constant values, low variation, and active signal presence within groups. This helper is designed to identify inactive files or channels before event-level EDA, HR, IBI, or multimodal analysis.
audit_gazepoint_signal_activity( data, signal_cols = NULL, group_cols = NULL, zero_is_inactive = TRUE, min_unique_nonzero = 2, missing_as_inactive = TRUE )audit_gazepoint_signal_activity( data, signal_cols = NULL, group_cols = NULL, zero_is_inactive = TRUE, min_unique_nonzero = 2, missing_as_inactive = TRUE )
data |
A data frame containing Gazepoint biometric rows. |
signal_cols |
Optional signal columns. If |
group_cols |
Optional grouping columns. If |
zero_is_inactive |
Logical. If |
min_unique_nonzero |
Minimum number of distinct non-zero finite values
required for an |
missing_as_inactive |
Logical. If |
A list with overview, signal_by_group, inactive_groups,
inactive_signals, and settings.
Checks that a smoke-test result contains no private paths, source filenames, participant-level identifier columns, or retained raw workflow objects.
audit_gazepoint_smoke_privacy(x, private_values = NULL)audit_gazepoint_smoke_privacy(x, private_values = NULL)
x |
Object returned by |
private_values |
Optional private path strings that must not occur in the object. |
A data frame of privacy checks and pass/fail statuses.
Flags or removes the initial stabilization period in each recording/group. This is intended to prevent early skin-electrode drift from being treated as a stable physiological baseline.
audit_gazepoint_stabilization_period( dat, time_col = "CNT", group_cols = NULL, stabilization_minutes = 10, action = c("flag", "trim"), output_col = "in_stabilization_period", time_units = c("auto", "seconds", "milliseconds") )audit_gazepoint_stabilization_period( dat, time_col = "CNT", group_cols = NULL, stabilization_minutes = 10, action = c("flag", "trim"), output_col = "in_stabilization_period", time_units = c("auto", "seconds", "milliseconds") )
dat |
A data frame. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns. |
stabilization_minutes |
Stabilization duration to flag or trim. |
action |
|
output_col |
Output logical flag column. |
time_units |
|
A data frame with stabilization-period attributes.
Detects negative time steps, duplicate time steps, non-finite time values, and
recording segments within grouped Gazepoint biometric exports. This helper is
intended for quality control and synchronization inspection. It does not alter
raw values unless return_reindexed_time = TRUE, in which case an additional
segment-relative time column is added.
audit_gazepoint_time_resets( data, time_col = NULL, group_cols = NULL, allow_ties = TRUE, split_on_negative_step = TRUE, return_reindexed_time = FALSE, min_segment_rows = 1 )audit_gazepoint_time_resets( data, time_col = NULL, group_cols = NULL, allow_ties = TRUE, split_on_negative_step = TRUE, return_reindexed_time = FALSE, min_segment_rows = 1 )
data |
A data frame containing Gazepoint biometric rows. |
time_col |
Optional time/counter column. If |
group_cols |
Optional grouping columns. If |
allow_ties |
Logical. If |
split_on_negative_step |
Logical. If |
return_reindexed_time |
Logical. If |
min_segment_rows |
Minimum rows expected per segment before a segment is flagged as short. |
A list with overview, segment_summary, row_flags,
data_with_segments, and settings.
Checks whether a time-course data set has a complete participant by condition
by time grid. This is intended as a safety diagnostic before calling
run_gazepoint_cluster_permutation().
audit_gazepoint_timecourse_grid( data, subject, condition, time, value = NULL, max_report_cells = 1000L )audit_gazepoint_timecourse_grid( data, subject, condition, time, value = NULL, max_report_cells = 1000L )
data |
A data frame. |
subject |
Participant identifier column, supplied as a bare column name or a single string. |
condition |
Condition column, supplied as a bare column name or a single string. |
time |
Time-bin column, supplied as a bare column name or a single string. |
value |
Optional numeric outcome column used to count missing outcome values. |
max_report_cells |
Maximum number of missing or duplicate cells stored in the returned object. |
An object of class gazepoint_timecourse_grid_audit.
Adds a baseline-corrected GSR/EDA column to a Gazepoint Biometrics table.
When available, GSR_US is used by default because it represents skin
conductance in microsiemens in Gazepoint exports. The baseline is estimated
from rows selected by baseline_rows, optionally within groups.
baseline_correct_gazepoint_gsr( data, baseline_rows, value_column = NULL, validity_column = "GSRV", group_columns = NULL, output_column = NULL, summary = c("mean", "median"), exclude_zero = TRUE )baseline_correct_gazepoint_gsr( data, baseline_rows, value_column = NULL, validity_column = "GSRV", group_columns = NULL, output_column = NULL, summary = c("mean", "median"), exclude_zero = TRUE )
data |
A data frame or a path to a Gazepoint CSV export. |
baseline_rows |
Logical vector identifying baseline rows. |
value_column |
Optional GSR/EDA value column. If |
validity_column |
Optional validity column. Defaults to |
group_columns |
Optional grouping columns. When supplied, baselines are estimated separately within each group. |
output_column |
Name of the corrected output column. |
summary |
Baseline summary, either |
exclude_zero |
Should zero values be excluded from baseline estimation? |
A data frame with the added baseline-corrected column and a
baseline-summary attribute named "baseline_summary".
Adds a baseline-corrected heart-rate column to a Gazepoint Biometrics table.
HRV is treated as the heart-rate validity flag, not as a heart-rate
variability metric.
baseline_correct_gazepoint_hr( data, baseline_rows, value_column = "HR", validity_column = "HRV", group_columns = NULL, output_column = NULL, summary = c("mean", "median"), exclude_zero = TRUE )baseline_correct_gazepoint_hr( data, baseline_rows, value_column = "HR", validity_column = "HRV", group_columns = NULL, output_column = NULL, summary = c("mean", "median"), exclude_zero = TRUE )
data |
A data frame or a path to a Gazepoint CSV export. |
baseline_rows |
Logical vector identifying baseline rows. |
value_column |
Heart-rate value column. Defaults to |
validity_column |
Heart-rate validity column. Defaults to |
group_columns |
Optional grouping columns. When supplied, baselines are estimated separately within each group. |
output_column |
Name of the corrected output column. |
summary |
Baseline summary, either |
exclude_zero |
Should zero values be excluded from baseline estimation? |
A data frame with the added baseline-corrected column and a
baseline-summary attribute named "baseline_summary".
Applies subtractive or divisive baseline correction to pupil-size data within trials or other grouping units.
baseline_correct_gazepoint_pupil( dat, pupil_col = NULL, time_col = "CNT", stimulus_onset_col = NULL, trial_cols = NULL, baseline_window = c(-240, -200), baseline_function = c("median", "mean"), correction = c("subtract", "divide"), suffix = "_baseline_corrected", min_baseline_rows = 2, overwrite = FALSE )baseline_correct_gazepoint_pupil( dat, pupil_col = NULL, time_col = "CNT", stimulus_onset_col = NULL, trial_cols = NULL, baseline_window = c(-240, -200), baseline_function = c("median", "mean"), correction = c("subtract", "divide"), suffix = "_baseline_corrected", min_baseline_rows = 2, overwrite = FALSE )
dat |
A data frame containing pupil-size data. |
pupil_col |
Pupil column. If |
time_col |
Time column. |
stimulus_onset_col |
Optional stimulus-onset column. If supplied, baseline windows are interpreted relative to onset. |
trial_cols |
Trial/grouping columns. |
baseline_window |
Numeric vector of length two defining the baseline window relative to stimulus onset. |
baseline_function |
|
correction |
|
suffix |
Suffix for corrected output column. |
min_baseline_rows |
Minimum finite baseline rows required. |
overwrite |
Logical. If |
A data frame with a corrected pupil column and baseline attributes.
Converts gaze or fixation samples into binned AOI proportions by participant, trial, condition, or other grouping columns. AOIs can be supplied as labels or derived from rectangular AOI definitions.
build_gazepoint_aoi_timecourse( data, time_col = NULL, aoi_col = NULL, x_col = NULL, y_col = NULL, aoi_definitions = NULL, group_cols = NULL, bin_width_s = 0.1, valid_col = NULL, include_empty = TRUE )build_gazepoint_aoi_timecourse( data, time_col = NULL, aoi_col = NULL, x_col = NULL, y_col = NULL, aoi_definitions = NULL, group_cols = NULL, bin_width_s = 0.1, valid_col = NULL, include_empty = TRUE )
data |
Gaze or fixation data frame. |
time_col |
Time column. |
aoi_col |
Optional AOI label column. |
x_col |
Optional x-coordinate column. |
y_col |
Optional y-coordinate column. |
aoi_definitions |
Optional data frame with |
group_cols |
Optional grouping columns. |
bin_width_s |
Bin width in seconds. |
valid_col |
Optional validity column. |
include_empty |
If TRUE, include AOI/bin combinations with zero samples. |
Tidy AOI time-course data frame.
Calculates dependency-light RSA proxy summaries from IBI/RR intervals and,
optionally, PPG-derived respiration features from
extract_gazepoint_pdr_signals(). This provides peak-to-trough and
Porges-Bohrer-inspired band-power proxy summaries. These outputs should be
interpreted as respiration-informed HRV/RSA features, not direct clinical
vagal-tone estimates.
calculate_gazepoint_rsa( dat, ibi_col = "IBI", time_col = "CNT", group_cols = NULL, pdr = NULL, resp_rate_hz = NULL, respiration_band = c(0.12, 0.4), resample_rate = 4 )calculate_gazepoint_rsa( dat, ibi_col = "IBI", time_col = "CNT", group_cols = NULL, pdr = NULL, resp_rate_hz = NULL, respiration_band = c(0.12, 0.4), resample_rate = 4 )
dat |
A data frame containing IBI/RR data. |
ibi_col |
IBI/RR interval column. |
time_col |
Time column for the IBI/RR observations. |
group_cols |
Optional grouping columns. |
pdr |
Optional output from |
resp_rate_hz |
Optional fixed respiration rate in Hz. |
respiration_band |
Default respiration/HF band when no PDR rate is available. |
resample_rate |
Resampling rate for spectral RSA proxy calculation. |
A list with overview, rsa_summary, and settings.
Performs a conservative, Gazepoint-oriented audit of a dataset folder that follows, or approximately follows, a BIDS-like organization. This function is not a full BIDS validator and does not convert data. It checks only simple, reviewable layout features such as dataset-level metadata files, subject folders, Gazepoint-like export files, and optional JSON sidecars.
check_gazepoint_bids( root, subject_pattern = "^sub-[A-Za-z0-9]+$", recursive = TRUE, expected_files = c("dataset_description.json", "participants.tsv"), gazepoint_patterns = c("all[_-]?gaze", "fixation", "summary", "biometric", "eda", "gsr", "ecg", "ppg", "hr", "ibi") )check_gazepoint_bids( root, subject_pattern = "^sub-[A-Za-z0-9]+$", recursive = TRUE, expected_files = c("dataset_description.json", "participants.tsv"), gazepoint_patterns = c("all[_-]?gaze", "fixation", "summary", "biometric", "eda", "gsr", "ecg", "ppg", "hr", "ibi") )
root |
Character scalar. Path to the dataset root folder. |
subject_pattern |
Regular expression used to identify subject folders.
Defaults to folders such as |
recursive |
Logical. Whether to search for Gazepoint export files
recursively under |
expected_files |
Character vector of optional dataset-level files to check. |
gazepoint_patterns |
Character vector of case-insensitive filename patterns used to identify Gazepoint-derived exports. |
A list with class gazepoint_bids_layout_audit containing the root
path, check table, discovered files, and summary counts.
Checks whether a data frame contains known Gazepoint Biometrics columns. This function does not assume that the channels are active. It only checks whether the expected columns are present.
check_gazepoint_biometric_columns(data)check_gazepoint_biometric_columns(data)
data |
A data frame imported from a Gazepoint export. |
A data frame describing expected columns, their signal family, interpretation, and whether they are present.
Checks whether an object follows the package's plotting return convention.
check_gazepoint_plot_contract( plot, require_plot_data = TRUE, require_settings = TRUE )check_gazepoint_plot_contract( plot, require_plot_data = TRUE, require_settings = TRUE )
plot |
A plot object. |
require_plot_data |
Logical. If |
require_settings |
Logical. If |
A list with overview, checks, plot_data, and settings.
Check binary quality of Gazepoint pulse/PPG analysis results
check_gazepoint_ppg_binary_quality( measures = NULL, peaks = NULL, min_peaks = 5L, bpm_range = c(40, 180), max_missing_prop = 0.25 )check_gazepoint_ppg_binary_quality( measures = NULL, peaks = NULL, min_peaks = 5L, bpm_range = c(40, 180), max_missing_prop = 0.25 )
measures |
Optional measures table. |
peaks |
Optional peaks table. |
min_peaks |
Minimum accepted peaks. |
bpm_range |
Plausible BPM range. |
max_missing_prop |
Maximum missing proportion, if available. |
Data frame with binary quality status.
Check whether NN intervals are inside a plausible interval
check_gazepoint_pyhrv_interval(nni_ms, min_ms = 250, max_ms = 2500)check_gazepoint_pyhrv_interval(nni_ms, min_ms = 250, max_ms = 2500)
nni_ms |
Numeric NN intervals in milliseconds. |
min_ms |
Minimum plausible interval. |
max_ms |
Maximum plausible interval. |
Data frame with interval status.
Adds programmatic fixed-duration chunks/episodes to continuous biometric data. This is useful for baseline segmentation, repeated-measures feature extraction, and analyses that do not rely on external TTL markers.
chunk_gazepoint_biometrics( dat, time_col = "CNT", group_cols = NULL, chunk_seconds = 60, start_time = NULL, chunk_col = "chunk_id", episode_col = "episode_id", include_partial = FALSE )chunk_gazepoint_biometrics( dat, time_col = "CNT", group_cols = NULL, chunk_seconds = 60, start_time = NULL, chunk_col = "chunk_id", episode_col = "episode_id", include_partial = FALSE )
dat |
A data frame. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns. |
chunk_seconds |
Chunk duration in seconds. |
start_time |
Optional fixed start time. If |
chunk_col |
Output chunk identifier column. |
episode_col |
Output episode label column. |
include_partial |
Logical. If |
A data frame with chunk columns and chunk-summary attributes.
Classifies descriptive EDA response patterns from an EDA/SCR feature column. The labels are intended for quality-control and descriptive reporting only. They do not infer emotion, valence, stress, trust, preference, cognition, or diagnosis.
classify_gazepoint_eda_response_pattern( data, response_col = NULL, group_cols = NULL, summary_function = c("max_abs", "mean_abs", "median_abs"), no_response_threshold = 0.01, low_response_threshold = 0.05, moderate_response_threshold = 0.2 )classify_gazepoint_eda_response_pattern( data, response_col = NULL, group_cols = NULL, summary_function = c("max_abs", "mean_abs", "median_abs"), no_response_threshold = 0.01, low_response_threshold = 0.05, moderate_response_threshold = 0.2 )
data |
A data frame containing EDA/SCR values. |
response_col |
Optional response feature column. If omitted, the helper
searches for common SCR/EDA response columns and then |
group_cols |
Optional grouping columns. |
summary_function |
Summary used within each group. |
no_response_threshold |
Absolute response threshold for
|
low_response_threshold |
Upper threshold for |
moderate_response_threshold |
Upper threshold for |
A list with overview, classifications, and settings.
Classifies extracted SCRs into first-, second-, and third-interval response windows based on response latency after stimulus onset.
classify_gazepoint_scr_intervals( dat, response_time_col = NULL, stimulus_onset_col = NULL, latency_col = NULL, output_col = "scr_interval", latency_output_col = "scr_latency_s", fir = c(1, 4), sir = c(4, 7), tir = c(7, 10) )classify_gazepoint_scr_intervals( dat, response_time_col = NULL, stimulus_onset_col = NULL, latency_col = NULL, output_col = "scr_interval", latency_output_col = "scr_latency_s", fir = c(1, 4), sir = c(4, 7), tir = c(7, 10) )
dat |
A data frame containing SCR events or peaks. |
response_time_col |
Optional response/peak time column. |
stimulus_onset_col |
Optional stimulus-onset column. Required when
|
latency_col |
Optional precomputed latency column. |
output_col |
Name of the output interval column. |
latency_output_col |
Name of the latency output column. |
fir |
Numeric vector of length two defining FIR window in seconds. |
sir |
Numeric vector of length two defining SIR window in seconds. |
tir |
Numeric vector of length two defining TIR window in seconds. |
A data frame with interval labels and latency metadata.
Applies user-visible threshold rules to a signal-quality table. The function adds review labels and failing-rule descriptions. It does not remove data.
classify_gazepoint_signal_quality(quality, rules = NULL)classify_gazepoint_signal_quality(quality, rules = NULL)
quality |
A data frame returned by
|
rules |
Optional named list of threshold rules. Missing rules use the
conservative defaults. Set a rule to |
A data frame with class
gazepoint_signal_quality_classification.
Compatibility helper for users searching for a short pupil-cleaning function.
By default it applies transparent blink/dropout interpolation using
interpolate_gazepoint_pupil_blinks(). Set prefer_existing = TRUE to
delegate to clean_gazepoint_pupil_signal() when compatible with the
supplied arguments.
clean_gazepoint_pupil( data, pupil_cols = NULL, time_col = NULL, blink_col = NULL, max_gap_s = NULL, method = c("linear", "constant"), suffix = "_clean", prefer_existing = FALSE, ... )clean_gazepoint_pupil( data, pupil_cols = NULL, time_col = NULL, blink_col = NULL, max_gap_s = NULL, method = c("linear", "constant"), suffix = "_clean", prefer_existing = FALSE, ... )
data |
Data frame containing pupil columns. |
pupil_cols |
Pupil columns to clean. If omitted, common pupil columns are detected. |
time_col |
Optional time column. |
blink_col |
Optional logical/numeric blink mask column. |
max_gap_s |
Optional maximum interpolated gap duration in seconds. |
method |
Interpolation method passed to |
suffix |
Suffix for cleaned pupil columns. |
prefer_existing |
If TRUE, first try |
... |
Additional arguments passed to the preferred existing cleaner when
|
Data frame with cleaned pupil columns and interpolation flags.
Flags blink samples, non-positive pupil values, and robust outlier spikes, then interpolates short missing segments. The function returns the original data with cleaned pupil columns and provenance flags.
clean_gazepoint_pupil_signal( data, pupil_cols = NULL, time_col = NULL, group_cols = NULL, validity_cols = NULL, method = c("linear", "locf", "nocb", "nearest", "constant"), max_gap = Inf, spike_mad = 6, combine = c("all", "any"), min_blink_samples = 1L, suffix = "_clean", keep_flags = TRUE )clean_gazepoint_pupil_signal( data, pupil_cols = NULL, time_col = NULL, group_cols = NULL, validity_cols = NULL, method = c("linear", "locf", "nocb", "nearest", "constant"), max_gap = Inf, spike_mad = 6, combine = c("all", "any"), min_blink_samples = 1L, suffix = "_clean", keep_flags = TRUE )
data |
Eye-tracking data frame. |
pupil_cols |
Pupil columns. If NULL, common Gazepoint pupil columns are detected automatically. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
validity_cols |
Optional validity columns corresponding to pupil columns. |
method |
Imputation method passed to |
max_gap |
Maximum missing run length, in samples, to interpolate. |
spike_mad |
Robust MAD threshold for pupil outlier spikes. |
combine |
Blink rule passed to |
min_blink_samples |
Minimum blink run length in samples. |
suffix |
Suffix for cleaned pupil columns. |
keep_flags |
If TRUE, add blink/spike/imputation flag columns. |
Data frame with cleaned pupil columns and a pupil_cleaning_summary
attribute.
dat <- data.frame(time_s = 0:4, LPD = c(3, NA, 3.2, 40, 3.1)) clean_gazepoint_pupil_signal(dat, pupil_cols = "LPD", time_col = "time_s")dat <- data.frame(time_s = 0:4, LPD = c(3, NA, 3.2, 40, 3.1)) clean_gazepoint_pupil_signal(dat, pupil_cols = "LPD", time_col = "time_s")
Clean RR or IBI intervals using HeartPy-style methods
clean_gazepoint_rr_intervals( rr_ms, method = c("quotient", "iqr", "modified_z", "zscore", "none"), group_col = "group", quotient_threshold = 0.2, iqr_multiplier = 1.5, z_threshold = 3.5 )clean_gazepoint_rr_intervals( rr_ms, method = c("quotient", "iqr", "modified_z", "zscore", "none"), group_col = "group", quotient_threshold = 0.2, iqr_multiplier = 1.5, z_threshold = 3.5 )
rr_ms |
Numeric RR/IBI intervals in milliseconds, or a peak table. |
method |
Cleaning method: quotient, iqr, modified_z, zscore, or none. |
group_col |
Group column when rr_ms is a peak table. |
quotient_threshold |
Maximum allowed ratio between adjacent intervals. |
iqr_multiplier |
IQR multiplier for IQR cleaning. |
z_threshold |
Z-score threshold. |
Cleaned interval table, or cleaned peak table when a peak table is supplied.
Combine multiple Gazepoint marker channels PsPM-style
combine_gazepoint_marker_channels_pspm_style( data, marker_cols = NULL, time_col = NULL, sampling_rate_hz = NULL, group_cols = NULL, combined_col = "pspm_marker" )combine_gazepoint_marker_channels_pspm_style( data, marker_cols = NULL, time_col = NULL, sampling_rate_hz = NULL, group_cols = NULL, combined_col = "pspm_marker" )
data |
Gazepoint data frame. |
marker_cols |
Marker columns to combine. |
time_col |
Time column. |
sampling_rate_hz |
Sampling rate if time column is absent. |
group_cols |
Optional grouping columns. |
combined_col |
Name of combined marker column. |
List with combined data and marker table.
Compares two conditions using a transparent percentile bootstrap. The helper
is intended for trial-level, participant-level, or event-locked summaries
produced by gpbiometrics. When participant_col is supplied, observations
are first averaged at the participant-by-condition level to reduce
pseudo-replication. When paired = TRUE, only participants with both
conditions are retained and resampled as paired units.
compare_gazepoint_conditions_bootstrap( data, outcome_col, condition_col, participant_col = NULL, condition_levels = NULL, paired = FALSE, by_cols = NULL, statistic = c("mean_difference", "median_difference", "standardized_mean_difference"), n_boot = 2000, conf_level = 0.95, seed = NULL, na_rm = TRUE )compare_gazepoint_conditions_bootstrap( data, outcome_col, condition_col, participant_col = NULL, condition_levels = NULL, paired = FALSE, by_cols = NULL, statistic = c("mean_difference", "median_difference", "standardized_mean_difference"), n_boot = 2000, conf_level = 0.95, seed = NULL, na_rm = TRUE )
data |
Data frame containing the outcome and condition columns. |
outcome_col |
Numeric outcome column. |
condition_col |
Two-level condition column. |
participant_col |
Optional participant/unit identifier. If supplied, the bootstrap uses participant-by-condition means. |
condition_levels |
Optional two-element character vector defining the
reference and target condition. The estimate is |
paired |
If TRUE, perform a paired participant-level bootstrap. Requires
|
by_cols |
Optional columns used to run separate comparisons by subgroup. |
statistic |
Statistic to bootstrap: |
n_boot |
Number of bootstrap resamples. |
conf_level |
Confidence level for percentile intervals. |
seed |
Optional random seed. |
na_rm |
If TRUE, remove rows with missing/non-finite outcomes or missing condition labels. |
Object of class gazepoint_bootstrap_condition_comparison, stored as
a data frame. Bootstrap samples are stored in the bootstrap_samples
attribute.
Compare two or more objects created by
profile_gazepoint_export_folder(). The comparison reports folder-level
dimensions and column-role coverage across profiles.
compare_gazepoint_export_profiles(..., labels = NULL)compare_gazepoint_export_profiles(..., labels = NULL)
... |
Profile objects returned by |
labels |
Optional labels for the profiles. |
A list with class "gazepoint_export_profile_comparison".
Compares recorded HR against HR derived from genuine IBI/RR intervals using
60000 / IBI_ms.
compare_gazepoint_hr_ibi_consistency( data, hr_col = "HR", ibi_col = "IBI", time_col = NULL, group_cols = NULL, unit = c("auto", "ms", "seconds"), max_abs_diff_bpm = 10, max_rel_diff_prop = 0.15 )compare_gazepoint_hr_ibi_consistency( data, hr_col = "HR", ibi_col = "IBI", time_col = NULL, group_cols = NULL, unit = c("auto", "ms", "seconds"), max_abs_diff_bpm = 10, max_rel_diff_prop = 0.15 )
data |
A Gazepoint biometric data frame or |
hr_col |
Heart-rate column in beats per minute. |
ibi_col |
IBI/RR interval column. |
time_col |
Optional time/counter column. |
group_cols |
Optional grouping columns. |
unit |
Unit of the IBI column: |
max_abs_diff_bpm |
Maximum acceptable absolute HR difference in bpm. |
max_rel_diff_prop |
Maximum acceptable relative HR difference. |
A list with overview, row_diagnostics, group_summary, and
settings.
Compare pyHRV-style PSD methods
compare_gazepoint_pyhrv_psd_methods( nni_ms, time_s = NULL, methods = c("welch", "lomb", "ar"), plot = FALSE )compare_gazepoint_pyhrv_psd_methods( nni_ms, time_s = NULL, methods = c("welch", "lomb", "ar"), plot = FALSE )
nni_ms |
Numeric NN intervals in milliseconds. |
time_s |
Optional time vector in seconds. |
methods |
Methods to compare. |
plot |
If TRUE, draw a comparison plot. |
List with method outputs and combined measures.
Computes ICC(A,1), Lin's concordance correlation coefficient, and Bland-Altman bias/95% limits. Agreement is deliberately scoped to the supplied metric and acquisition configuration; it is not a global ECG/PPG equivalence decision.
compare_hrv_prv_devices( reference, candidate, metric, reference_source = "ECG-HRV", candidate_source = "PPG-PRV", reference_site = NA_character_, candidate_site = NA_character_ )compare_hrv_prv_devices( reference, candidate, metric, reference_source = "ECG-HRV", candidate_source = "PPG-PRV", reference_site = NA_character_, candidate_site = NA_character_ )
reference, candidate
|
Paired numeric values. |
metric |
Name of the derived metric (for example |
reference_source, candidate_source
|
Signal-source labels. |
reference_site, candidate_site
|
Optional sensor-site labels. |
A metric-specific agreement record.
Summarizes a continuous engagement-dial signal, typically scaled from 0 to 100, into interpretable behavioral indices such as mean engagement, percent time above threshold, volatility, and area under the curve.
compute_gazepoint_engagement_index( dial, time = NULL, threshold = 50, group = NULL, return = c("data", "scalar") )compute_gazepoint_engagement_index( dial, time = NULL, threshold = 50, group = NULL, return = c("data", "scalar") )
dial |
Numeric engagement-dial values. |
time |
Optional time vector. |
threshold |
Engagement threshold. |
group |
Optional grouping vector for grouped summaries. |
return |
|
Data frame of engagement metrics or a scalar.
compute_gazepoint_engagement_index(c(20, 60, 80), time = 1:3)compute_gazepoint_engagement_index(c(20, 60, 80), time = 1:3)
Computes a conservative Haar-style multiscale power summary for RR/NN intervals. This is intended as a lightweight, CRAN-safe exploratory nonstationary-HRV helper, not as a replacement for specialist HRV packages.
compute_gazepoint_hrv_wavelet_psd( rr_intervals, time = NULL, bands = list(vlf = c(0.0033, 0.04), lf = c(0.04, 0.15), hf = c(0.15, 0.4)), max_scale = NULL )compute_gazepoint_hrv_wavelet_psd( rr_intervals, time = NULL, bands = list(vlf = c(0.0033, 0.04), lf = c(0.04, 0.15), hf = c(0.15, 0.4)), max_scale = NULL )
rr_intervals |
Numeric RR/NN intervals in milliseconds or seconds. |
time |
Optional timestamps for intervals. |
bands |
Named list of frequency bands in Hz. |
max_scale |
Optional maximum Haar scale in beats. |
List with psd, band_power, and settings.
Compute Gazepoint pulse/PPG frequency-domain measures
compute_gazepoint_ppg_frequency_measures( peaks = NULL, rr_ms = NULL, rr_time_s = NULL, group_col = "group", method = c("welch", "fft", "periodogram"), resample_hz = 4, bands = list(lf = c(0.05, 0.15), hf = c(0.15, 0.5)), welch_window_seconds = 64, welch_overlap = 0.5 )compute_gazepoint_ppg_frequency_measures( peaks = NULL, rr_ms = NULL, rr_time_s = NULL, group_col = "group", method = c("welch", "fft", "periodogram"), resample_hz = 4, bands = list(lf = c(0.05, 0.15), hf = c(0.15, 0.5)), welch_window_seconds = 64, welch_overlap = 0.5 )
peaks |
Optional peak table. |
rr_ms |
Optional RR/IBI intervals in milliseconds. |
rr_time_s |
Optional interval timestamps. |
group_col |
Group column when peaks are supplied. |
method |
PSD method: fft, periodogram, or welch. |
resample_hz |
RR interpolation frequency. |
bands |
Named list of frequency bands. |
welch_window_seconds |
Welch window length. |
welch_overlap |
Welch overlap proportion. |
Data frame of frequency-domain measures.
Compute HeartPy-style pulse/PPG measures
compute_gazepoint_ppg_measures(peaks, group_col = "group")compute_gazepoint_ppg_measures(peaks, group_col = "group")
peaks |
Peak table from detect_gazepoint_ppg_peaks() or reject_gazepoint_ppg_peaks(). |
group_col |
Group column. |
Data frame with BPM, IBI, SDNN, SDSD, RMSSD, pNN20, pNN50, MAD, LF, HF, HF/LF, and breathing rate.
Extracts peak-centered PPG windows, builds a median beat template, and computes per-beat correlation with the template as an interpretable quality metric.
compute_gazepoint_ppg_template_similarity( data, time_col = NULL, ppg_col = NULL, peaks = NULL, window_s = c(-0.25, 0.45), sampling_rate_hz = NULL, n_grid = 101, similarity_threshold = 0.8 )compute_gazepoint_ppg_template_similarity( data, time_col = NULL, ppg_col = NULL, peaks = NULL, window_s = c(-0.25, 0.45), sampling_rate_hz = NULL, n_grid = 101, similarity_threshold = 0.8 )
data |
PPG data frame or numeric PPG vector. |
time_col |
Time column for data-frame input. |
ppg_col |
PPG/BVP signal column for data-frame input. |
peaks |
Optional peak indices or peak times. |
window_s |
Two-element window around each peak in seconds. |
sampling_rate_hz |
Sampling rate for vector input or when time is absent. |
n_grid |
Number of points in the normalized beat template. |
similarity_threshold |
Correlation threshold for |
List with beats, template, summary, and settings.
Compute pyHRV-style autoregressive PSD
compute_gazepoint_pyhrv_ar_psd( nni_ms, time_s = NULL, resample_hz = 4, order = NULL )compute_gazepoint_pyhrv_ar_psd( nni_ms, time_s = NULL, resample_hz = 4, order = NULL )
nni_ms |
Numeric NN intervals in milliseconds. |
time_s |
Optional time vector in seconds. |
resample_hz |
Resampling frequency. |
order |
Optional AR order. |
List with PSD and measures.
Compute detrended fluctuation analysis
compute_gazepoint_pyhrv_dfa( nni_ms, scales = unique(round(exp(seq(log(4), log(64), length.out = 12)))) )compute_gazepoint_pyhrv_dfa( nni_ms, scales = unique(round(exp(seq(log(4), log(64), length.out = 12)))) )
nni_ms |
Numeric NN intervals in milliseconds. |
scales |
Window sizes in beats. |
Data frame with DFA alpha estimates.
Compute pyHRV-style frequency-domain summary
compute_gazepoint_pyhrv_frequency_domain( nni_ms, time_s = NULL, method = c("welch", "lomb", "ar") )compute_gazepoint_pyhrv_frequency_domain( nni_ms, time_s = NULL, method = c("welch", "lomb", "ar") )
nni_ms |
Numeric NN intervals in milliseconds. |
time_s |
Optional time vector in seconds. |
method |
Frequency method: welch, lomb, or ar. |
List with PSD and measures.
Compute heart rate from NN intervals
compute_gazepoint_pyhrv_heart_rate(nni_ms)compute_gazepoint_pyhrv_heart_rate(nni_ms)
nni_ms |
Numeric NN intervals in milliseconds. |
Numeric heart rate in beats per minute.
Compute pyHRV-style heart-rate parameters
compute_gazepoint_pyhrv_hr_parameters(nni_ms)compute_gazepoint_pyhrv_hr_parameters(nni_ms)
nni_ms |
Numeric NN intervals in milliseconds. |
Data frame of heart-rate parameters.
Compute pyHRV-style Lomb PSD
compute_gazepoint_pyhrv_lomb_psd( nni_ms, time_s = NULL, min_hz = 0.003, max_hz = 0.4, n_freq = 512 )compute_gazepoint_pyhrv_lomb_psd( nni_ms, time_s = NULL, min_hz = 0.003, max_hz = 0.4, n_freq = 512 )
nni_ms |
Numeric NN intervals in milliseconds. |
time_s |
Optional time vector in seconds. |
min_hz |
Minimum frequency. |
max_hz |
Maximum frequency. |
n_freq |
Number of frequencies. |
List with PSD and measures.
Compute NN interval differences
compute_gazepoint_pyhrv_nn_diff(nni_ms, absolute = FALSE)compute_gazepoint_pyhrv_nn_diff(nni_ms, absolute = FALSE)
nni_ms |
Numeric NN intervals in milliseconds. |
absolute |
If TRUE, return absolute differences. |
Numeric successive NN differences in milliseconds.
Compute NN20 and pNN20
compute_gazepoint_pyhrv_nn20(nni_ms)compute_gazepoint_pyhrv_nn20(nni_ms)
nni_ms |
Numeric NN intervals in milliseconds. |
Data frame with NN20 and pNN20.
Compute NN50 and pNN50
compute_gazepoint_pyhrv_nn50(nni_ms)compute_gazepoint_pyhrv_nn50(nni_ms)
nni_ms |
Numeric NN intervals in milliseconds. |
Data frame with NN50 and pNN50.
Compute pyHRV-style NNI difference parameters
compute_gazepoint_pyhrv_nni_differences_parameters(nni_ms)compute_gazepoint_pyhrv_nni_differences_parameters(nni_ms)
nni_ms |
Numeric NN intervals in milliseconds. |
Data frame of successive-difference parameters.
Compute pyHRV-style NNI parameters
compute_gazepoint_pyhrv_nni_parameters(nni_ms)compute_gazepoint_pyhrv_nni_parameters(nni_ms)
nni_ms |
Numeric NN intervals in milliseconds. |
Data frame of NNI parameters.
Compute NNxx and pNNxx
compute_gazepoint_pyhrv_nnxx(nni_ms, threshold_ms = 50)compute_gazepoint_pyhrv_nnxx(nni_ms, threshold_ms = 50)
nni_ms |
Numeric NN intervals in milliseconds. |
threshold_ms |
Threshold in milliseconds. |
Data frame with NNxx and pNNxx.
Compute pyHRV-style nonlinear summary
compute_gazepoint_pyhrv_nonlinear(nni_ms)compute_gazepoint_pyhrv_nonlinear(nni_ms)
nni_ms |
Numeric NN intervals in milliseconds. |
Data frame with nonlinear measures.
Compute pyHRV-style Poincare measures
compute_gazepoint_pyhrv_poincare(nni_ms, plot = FALSE)compute_gazepoint_pyhrv_poincare(nni_ms, plot = FALSE)
nni_ms |
Numeric NN intervals in milliseconds. |
plot |
If TRUE, draw Poincare plot. |
Data frame of Poincare measures.
Compute pyHRV-style PSD waterfall over segments
compute_gazepoint_pyhrv_psd_waterfall( nni_ms, segment_seconds = 300, method = c("welch", "lomb", "ar"), plot = FALSE )compute_gazepoint_pyhrv_psd_waterfall( nni_ms, segment_seconds = 300, method = c("welch", "lomb", "ar"), plot = FALSE )
nni_ms |
Numeric NN intervals in milliseconds. |
segment_seconds |
Segment length. |
method |
Frequency method. |
plot |
If TRUE, draw a heatmap-style waterfall. |
List with PSD grid and segment measures.
Compute RMSSD
compute_gazepoint_pyhrv_rmssd(nni_ms)compute_gazepoint_pyhrv_rmssd(nni_ms)
nni_ms |
Numeric NN intervals in milliseconds. |
RMSSD in milliseconds.
Compute sample entropy
compute_gazepoint_pyhrv_sample_entropy(nni_ms, m = 2L, r = NULL)compute_gazepoint_pyhrv_sample_entropy(nni_ms, m = 2L, r = NULL)
nni_ms |
Numeric NN intervals in milliseconds. |
m |
Embedding dimension. |
r |
Tolerance. If NULL, 0.2 * SD is used. |
Sample entropy.
Compute SDANN
compute_gazepoint_pyhrv_sdann(nni_ms, segment_seconds = 300)compute_gazepoint_pyhrv_sdann(nni_ms, segment_seconds = 300)
nni_ms |
Numeric NN intervals in milliseconds. |
segment_seconds |
Segment length. |
SDANN in milliseconds.
Compute SDNN
compute_gazepoint_pyhrv_sdnn(nni_ms)compute_gazepoint_pyhrv_sdnn(nni_ms)
nni_ms |
Numeric NN intervals in milliseconds. |
SDNN in milliseconds.
Compute SDNN index
compute_gazepoint_pyhrv_sdnn_index(nni_ms, segment_seconds = 300)compute_gazepoint_pyhrv_sdnn_index(nni_ms, segment_seconds = 300)
nni_ms |
Numeric NN intervals in milliseconds. |
segment_seconds |
Segment length. |
SDNN index in milliseconds.
Compute SDSD
compute_gazepoint_pyhrv_sdsd(nni_ms)compute_gazepoint_pyhrv_sdsd(nni_ms)
nni_ms |
Numeric NN intervals in milliseconds. |
SDSD in milliseconds.
Compute pyHRV-style time-domain summary
compute_gazepoint_pyhrv_time_domain(nni_ms, segment_seconds = 300)compute_gazepoint_pyhrv_time_domain(nni_ms, segment_seconds = 300)
nni_ms |
Numeric NN intervals in milliseconds. |
segment_seconds |
Segment length for SDNN index and SDANN. |
Data frame with time-domain HRV measures.
Compute TINN
compute_gazepoint_pyhrv_tinn(nni_ms, bin_width_ms = 7.8125)compute_gazepoint_pyhrv_tinn(nni_ms, bin_width_ms = 7.8125)
nni_ms |
Numeric NN intervals in milliseconds. |
bin_width_ms |
Histogram bin width. |
Approximate TINN in milliseconds.
Compute triangular index
compute_gazepoint_pyhrv_triangular_index(nni_ms, bin_width_ms = 7.8125)compute_gazepoint_pyhrv_triangular_index(nni_ms, bin_width_ms = 7.8125)
nni_ms |
Numeric NN intervals in milliseconds. |
bin_width_ms |
Histogram bin width. |
HRV triangular index.
Compute pyHRV-style Welch PSD
compute_gazepoint_pyhrv_welch_psd( nni_ms, time_s = NULL, resample_hz = 4, window_seconds = 256, overlap = 0.5 )compute_gazepoint_pyhrv_welch_psd( nni_ms, time_s = NULL, resample_hz = 4, window_seconds = 256, overlap = 0.5 )
nni_ms |
Numeric NN intervals in milliseconds. |
time_s |
Optional time vector in seconds. |
resample_hz |
Resampling frequency. |
window_seconds |
Welch window length. |
overlap |
Window overlap proportion. |
List with PSD and measures.
Combines user-selected numeric QC metrics into a transparent row-level heuristic quality index. Metrics are range-scaled by default and combined using user-supplied directions and weights. The result is intended for quality-control summaries only. It does not remove data and does not make physiological, psychological, diagnostic, or clinical claims.
compute_gazepoint_quality_index( data, metric_cols, directions = NULL, weights = NULL, index_col = "quality_index", component_prefix = "quality_component_", overwrite = FALSE )compute_gazepoint_quality_index( data, metric_cols, directions = NULL, weights = NULL, index_col = "quality_index", component_prefix = "quality_component_", overwrite = FALSE )
data |
A data frame. |
metric_cols |
Character vector of numeric QC metric columns. |
directions |
Direction for each metric. Use |
weights |
Optional non-negative numeric weights. May be unnamed, named by metric, or length one. |
index_col |
Name of the output quality-index column. |
component_prefix |
Prefix used for metric component-score columns. |
overwrite |
Logical. If |
A data frame with class gazepoint_quality_index.
Estimates habituation of SCR amplitudes across ordered trials, either for a vector or within subjects/groups in a data frame.
compute_gazepoint_scr_habituation( data, amplitude_col = NULL, trial_col = NULL, subject_col = NULL, method = c("linear", "log_linear", "ratio"), min_trials = 3 )compute_gazepoint_scr_habituation( data, amplitude_col = NULL, trial_col = NULL, subject_col = NULL, method = c("linear", "log_linear", "ratio"), min_trials = 3 )
data |
Numeric SCR-amplitude vector or data frame. |
amplitude_col |
SCR amplitude column for data-frame input. |
trial_col |
Trial/order column for data-frame input. |
subject_col |
Optional subject/grouping column. |
method |
|
min_trials |
Minimum valid trials required for model-based estimates. |
Data frame with habituation slope, p value, correlation, and first/last response summaries.
Estimates onset latency, peak latency, peak amplitude, AUC, and half-recovery latency for each event using a baseline window and response window.
compute_gazepoint_scr_latency( data, events, time_col = NULL, eda_col = NULL, event_time_col = NULL, event_id_col = NULL, group_cols = NULL, baseline_window_s = c(-1, 0), response_window_s = c(0, 5), onset_threshold = 0.01, recovery_fraction = 0.5 )compute_gazepoint_scr_latency( data, events, time_col = NULL, eda_col = NULL, event_time_col = NULL, event_id_col = NULL, group_cols = NULL, baseline_window_s = c(-1, 0), response_window_s = c(0, 5), onset_threshold = 0.01, recovery_fraction = 0.5 )
data |
Data frame containing EDA/GSR samples. |
events |
Event table or numeric event times. |
time_col |
Time column in |
eda_col |
EDA/GSR column. |
event_time_col |
Event-time column. |
event_id_col |
Event identifier column. |
group_cols |
Optional grouping columns used to match events to samples. |
baseline_window_s |
Two-element baseline window relative to event. |
response_window_s |
Two-element response window relative to event. |
onset_threshold |
Minimum increase above baseline used for onset. |
recovery_fraction |
Fraction of peak amplitude used for recovery time. |
Data frame with one row per event.
Compute signal band power
compute_gazepoint_signal_band_power( x, sampling_rate_hz = NULL, bands = list(very_low = c(0.003, 0.04), low = c(0.04, 0.15), high = c(0.15, 0.4)), relative = TRUE )compute_gazepoint_signal_band_power( x, sampling_rate_hz = NULL, bands = list(very_low = c(0.003, 0.04), low = c(0.04, 0.15), high = c(0.15, 0.4)), relative = TRUE )
x |
Numeric signal or power-spectrum data frame. |
sampling_rate_hz |
Sampling rate in Hz when x is a signal. |
bands |
Named list of frequency bands. |
relative |
If TRUE, include relative band power. |
Data frame of band powers.
Compute correlation between two Gazepoint signals
compute_gazepoint_signal_correlation( x, y, method = c("pearson", "spearman", "kendall"), lag_max = NULL )compute_gazepoint_signal_correlation( x, y, method = c("pearson", "spearman", "kendall"), lag_max = NULL )
x |
First numeric signal. |
y |
Second numeric signal. |
method |
Correlation method. |
lag_max |
Optional maximum lag in samples for cross-correlation. |
Correlation summary.
Computes pairwise lag/correlation summaries across synchronized numeric signals. The output is useful as a compact multimodal lag screen before event-locked or mixed-model analyses.
compute_gazepoint_signal_lag_matrix( data, signal_cols = NULL, time_col = NULL, group_cols = NULL, max_lag_s = 2, lag_step_s = NULL, min_overlap = 10 )compute_gazepoint_signal_lag_matrix( data, signal_cols = NULL, time_col = NULL, group_cols = NULL, max_lag_s = 2, lag_step_s = NULL, min_overlap = 10 )
data |
Data frame with a common time column and numeric signals. |
signal_cols |
Numeric signal columns. If omitted, all numeric columns
except |
time_col |
Time column. |
group_cols |
Optional grouping columns. |
max_lag_s |
Maximum lag in seconds. |
lag_step_s |
Optional lag-step size. If omitted, the median sample interval is used. |
min_overlap |
Minimum paired samples required per lag. |
Data frame with one row per group and signal pair.
Compute phase-locking value between two signals
compute_gazepoint_signal_phase_locking(x, y, sampling_rate_hz, band = NULL)compute_gazepoint_signal_phase_locking(x, y, sampling_rate_hz, band = NULL)
x |
First numeric signal. |
y |
Second numeric signal. |
sampling_rate_hz |
Sampling rate in Hz. |
band |
Optional two-element frequency band. |
Data frame with phase-locking value and circular phase difference.
Compute signal power spectrum
compute_gazepoint_signal_power_spectrum(x, sampling_rate_hz, detrend = TRUE)compute_gazepoint_signal_power_spectrum(x, sampling_rate_hz, detrend = TRUE)
x |
Numeric signal. |
sampling_rate_hz |
Sampling rate in Hz. |
detrend |
If TRUE, remove the mean before FFT. |
Data frame with frequency and power.
Computes conservative, rule-based descriptive quality indicators for one or more Gazepoint biometric signal columns. The function does not interpret the physiological meaning of the signal and does not exclude data.
compute_gazepoint_signal_quality( data, signal_cols, group_cols = NULL, flatline_tolerance = 0, long_missing_run_threshold = 10, long_constant_run_threshold = 10, spike_z = 4, extreme_z = 4 )compute_gazepoint_signal_quality( data, signal_cols, group_cols = NULL, flatline_tolerance = 0, long_missing_run_threshold = 10, long_constant_run_threshold = 10, spike_z = 4, extreme_z = 4 )
data |
A data frame. |
signal_cols |
Character vector of numeric signal columns to evaluate. |
group_cols |
Optional character vector of grouping columns, such as participant, trial, condition, session, window, or segment identifiers. |
flatline_tolerance |
Numeric tolerance used when detecting adjacent constant values. Defaults to 0. |
long_missing_run_threshold |
Integer threshold used to count whether a segment contains a long missing run. The maximum run length is always returned regardless of this threshold. |
long_constant_run_threshold |
Integer threshold used to count whether a segment contains a long constant run. The maximum run length is always returned regardless of this threshold. |
spike_z |
Numeric z-score threshold for adjacent-change spikes. |
extreme_z |
Numeric z-score threshold for extreme standardized values. |
A data frame with class gazepoint_signal_quality.
Converts GSR resistance values to conductance in microSiemens. The helper is
intentionally conservative. If a conductance column such as GSR_US is
already present, the data are returned unchanged unless overwrite = TRUE.
If input_unit = "auto", conversion is performed only when the source column
has a resistance-like name, such as GSR_OHMS or resistance_ohms.
convert_gazepoint_gsr_to_conductance( data, gsr_col = NULL, output_col = "GSR_US", input_unit = c("auto", "ohms", "kohms", "microsiemens"), overwrite = FALSE )convert_gazepoint_gsr_to_conductance( data, gsr_col = NULL, output_col = "GSR_US", input_unit = c("auto", "ohms", "kohms", "microsiemens"), overwrite = FALSE )
data |
A data frame. |
gsr_col |
Optional source GSR column. If |
output_col |
Name of the output conductance column. |
input_unit |
Source unit. |
overwrite |
Logical. If |
Generic GSR columns are not automatically assumed to be resistance because
Gazepoint exports and workflows may represent GSR/EDA differently. For a
generic GSR column, use input_unit = "ohms" or input_unit = "kohms"
only when the study documentation confirms resistance units.
The input data frame with a conductance column when conversion is
possible. A structured conversion summary is stored in the
gsr_conversion_summary attribute.
df <- data.frame(GSR_OHMS = c(1000000, 500000, NA)) convert_gazepoint_gsr_to_conductance(df)df <- data.frame(GSR_OHMS = c(1000000, 500000, NA)) convert_gazepoint_gsr_to_conductance(df)
Applies a conservative correction action to beats flagged by
audit_gazepoint_beats(). The default action masks flagged intervals by
setting their corrected IBI to NA. The local-median action replaces
flagged intervals only when an unflagged local or group median is available.
Every change is logged. The function does not add or remove beat rows and does
not compute or interpret HRV outcomes.
correct_gazepoint_beats( audit, action = c("mask", "local_median"), corrected_col = "ibi_corrected", local_window = 5, overwrite = FALSE, ... )correct_gazepoint_beats( audit, action = c("mask", "local_median"), corrected_col = "ibi_corrected", local_window = 5, overwrite = FALSE, ... )
audit |
A |
action |
Correction action. One of |
corrected_col |
Name of the corrected IBI column to create. |
local_window |
Number of rows on each side to inspect for local-median
replacement when |
overwrite |
Logical. If |
... |
Arguments passed to |
A list with class gazepoint_beat_correction, containing
corrected beat data, a correction log, a summary table, and parameters.
Regresses an EDA/conductance signal on one or more continuous temperature covariates and returns a temperature-adjusted residual series. The adjusted signal is temperature-adjusted EDA, not "pure" cognitive or emotional EDA.
correct_gazepoint_eda_temperature( dat, eda_col = "GSR_US", temperature_cols, group_cols = NULL, time_col = NULL, output_col = "eda_temperature_adjusted", fitted_col = "eda_temperature_fitted", model_by_group = TRUE, add_intercept_mean = TRUE )correct_gazepoint_eda_temperature( dat, eda_col = "GSR_US", temperature_cols, group_cols = NULL, time_col = NULL, output_col = "eda_temperature_adjusted", fitted_col = "eda_temperature_fitted", model_by_group = TRUE, add_intercept_mean = TRUE )
dat |
A data frame. |
eda_col |
Numeric EDA/conductance column. |
temperature_cols |
One or more numeric temperature columns. |
group_cols |
Optional grouping columns. |
time_col |
Optional time column retained in summaries. |
output_col |
Output residual-adjusted EDA column. |
fitted_col |
Output fitted temperature component column. |
model_by_group |
Logical. If |
add_intercept_mean |
Logical. If |
A data frame with adjusted EDA columns and model-summary attributes.
Apply Hampel-style correction to raw pulse/PPG data
correct_gazepoint_ppg_hampel( x, sampling_rate_hz, window_seconds = 1, n_sigmas = 3 )correct_gazepoint_ppg_hampel( x, sampling_rate_hz, window_seconds = 1, n_sigmas = 3 )
x |
Numeric signal. |
sampling_rate_hz |
Sampling rate in Hz. |
window_seconds |
Running median window length. |
n_sigmas |
Threshold in MAD units. |
Corrected numeric signal.
Correct local RRI/IBI artifacts
correct_gazepoint_rri_artifacts_local( rri_ms, method = c("local_median", "quotient", "zscore"), window_intervals = 5L, threshold = 0.2, replacement = c("local_median", "interpolate") )correct_gazepoint_rri_artifacts_local( rri_ms, method = c("local_median", "quotient", "zscore"), window_intervals = 5L, threshold = 0.2, replacement = c("local_median", "interpolate") )
rri_ms |
Numeric RRI/IBI intervals in milliseconds. |
method |
local_median, quotient, or zscore. |
window_intervals |
Local window in intervals. |
threshold |
Threshold for artifact detection. |
replacement |
Replacement method: local_median or interpolate. |
Data frame with corrected RRI values and artifact flags.
Create an empty structured log for recording preprocessing choices, exclusions, missing channels, quality-control decisions, modelling settings, cluster-permutation settings, and reviewer-facing notes.
create_gazepoint_analysis_decision_log( study_id = NA_character_, analyst = NA_character_, description = NA_character_ )create_gazepoint_analysis_decision_log( study_id = NA_character_, analyst = NA_character_, description = NA_character_ )
study_id |
Optional study identifier. |
analyst |
Optional analyst name or identifier. |
description |
Optional free-text description of the analysis workflow. |
A data frame with class "gazepoint_analysis_decision_log".
log <- create_gazepoint_analysis_decision_log( study_id = "demo_study", analyst = "analyst" ) log <- add_gazepoint_decision( log, stage = "preprocessing", object_type = "signal", object_id = "GSR", decision = "baseline_corrected", reason = "Pre-event baseline window available", function_name = "baseline_correct_gazepoint_gsr", parameter = "baseline_window", value = "-1000_to_0_ms" ) summarise_gazepoint_decision_log(log)log <- create_gazepoint_analysis_decision_log( study_id = "demo_study", analyst = "analyst" ) log <- add_gazepoint_decision( log, stage = "preprocessing", object_type = "signal", object_id = "GSR", decision = "baseline_corrected", reason = "Pre-event baseline window available", function_name = "baseline_correct_gazepoint_gsr", parameter = "baseline_window", value = "-1000_to_0_ms" ) summarise_gazepoint_decision_log(log)
Creates a reproducibility manifest containing package version, files, settings,
outputs, exclusions, and optional session information. If path is supplied,
a plain-text manifest is written for audit trails.
create_gazepoint_analysis_manifest( files = NULL, settings = list(), outputs = NULL, exclusions = NULL, path = NULL, include_session = TRUE )create_gazepoint_analysis_manifest( files = NULL, settings = list(), outputs = NULL, exclusions = NULL, path = NULL, include_session = TRUE )
files |
Optional character vector of input files. |
settings |
Optional named list of analysis settings. |
outputs |
Optional named list or character vector of generated outputs. |
exclusions |
Optional data frame or named list of exclusions. |
path |
Optional output path for a text manifest. |
include_session |
If TRUE, include |
Manifest list.
Normalizes one or more Gazepoint audit/check objects into a single tabular index. The function is designed for reproducibility and reporting: it records object identifiers, source tables, checks, items, statuses, messages, and optional paths. It does not modify data and does not make scientific or clinical interpretations.
create_gazepoint_audit_index( audits, audit_ids = NULL, include_summary_rows = FALSE )create_gazepoint_audit_index( audits, audit_ids = NULL, include_summary_rows = FALSE )
audits |
A single audit object, a data frame, or a named/unnamed list of
audit objects. Recognized list elements include |
audit_ids |
Optional character vector of audit identifiers. If omitted,
names from |
include_summary_rows |
Logical. If |
A data frame with class gazepoint_audit_index.
Create a concise integrated report section from available Gazepoint audit objects.
create_gazepoint_audit_report_section( export_profile = NULL, design_audit = NULL, event_audit = NULL, condition_audit = NULL, decision_log = NULL, include_warnings = TRUE )create_gazepoint_audit_report_section( export_profile = NULL, design_audit = NULL, event_audit = NULL, condition_audit = NULL, decision_log = NULL, include_warnings = TRUE )
export_profile |
Optional object from |
design_audit |
Optional object from |
event_audit |
Optional object from |
condition_audit |
Optional object from |
decision_log |
Optional object from |
include_warnings |
Logical. If |
A character vector with class "gazepoint_report_text".
Creates a compact reporting checklist for Gazepoint Biometrics exports. The checklist summarises detected biometric channels, validation issues, signal quality, missingness, available workflow domains, and interpretation cautions. It is intended to support transparent manuscript reporting and reviewer-facing methods documentation.
create_gazepoint_biometrics_checklist(data, require_active_signal = TRUE)create_gazepoint_biometrics_checklist(data, require_active_signal = TRUE)
data |
A data frame or a path to a Gazepoint CSV export. |
require_active_signal |
Logical. Should inactive biometric channels be flagged in the validation output? |
A list with overview, channels, quality, missingness,
validation_issues, workflow_capabilities, feature_inventory,
reporting_guidance, and interpretation_cautions.
Creates a structured inventory of implemented gpbiometrics helper functions. This is useful for reporting, readiness checks, documentation, and package development audits.
create_gazepoint_biometrics_feature_inventory(include_internal = FALSE)create_gazepoint_biometrics_feature_inventory(include_internal = FALSE)
include_internal |
Logical. If |
A list with overview, inventory, domain_summary,
missing_expected, and settings.
Creates a compact draft methods paragraph describing Gazepoint Biometrics data processing. The text is intentionally cautious and avoids making emotional or cognitive claims from physiological or eye-tracking measures alone.
create_gazepoint_biometrics_methods_text( checklist = NULL, data = NULL, include_cautions = TRUE )create_gazepoint_biometrics_methods_text( checklist = NULL, data = NULL, include_cautions = TRUE )
checklist |
A checklist produced by
|
data |
Optional data frame or path to a Gazepoint CSV export used to
create the checklist when |
include_cautions |
Logical. Should interpretation cautions be appended? |
A character string containing draft methods text.
Creates a structured, manuscript-oriented report object for Gazepoint
Biometrics data, workflow outputs, quality checks, report tables, methods
text, and reporting checklists. The report is intentionally conservative:
GSR/EDA is described as electrodermal activity/arousal-related signal rather
than emotional valence; heart-rate interpretation is tied to baseline/task
context; eye-tracking is described as visual attention rather than direct
cognition; and raw HRV columns are not treated as HRV metrics.
create_gazepoint_biometrics_report( data = NULL, workflow = NULL, validation = NULL, quality = NULL, sampling = NULL, missingness = NULL, exclusions = NULL, report_tables = NULL, methods_text = NULL, checklist = NULL, title = "Gazepoint Biometrics report", subtitle = NULL, output_file = NULL, format = c("markdown", "html"), include_timestamp = FALSE, overwrite = FALSE, max_table_rows = 20L )create_gazepoint_biometrics_report( data = NULL, workflow = NULL, validation = NULL, quality = NULL, sampling = NULL, missingness = NULL, exclusions = NULL, report_tables = NULL, methods_text = NULL, checklist = NULL, title = "Gazepoint Biometrics report", subtitle = NULL, output_file = NULL, format = c("markdown", "html"), include_timestamp = FALSE, overwrite = FALSE, max_table_rows = 20L )
data |
Optional biometric data frame. |
workflow |
Optional workflow object or workflow summary list. |
validation |
Optional validation object or data frame. |
quality |
Optional quality-audit object or data frame. |
sampling |
Optional sampling-audit object or data frame. |
missingness |
Optional missingness-audit object or data frame. |
exclusions |
Optional exclusion-recommendation object or data frame. |
report_tables |
Optional report-table object, data frame, or named list of data frames. |
methods_text |
Optional methods text, character vector, or object
returned by |
checklist |
Optional checklist object or data frame. |
title |
Report title. |
subtitle |
Optional report subtitle. |
output_file |
Optional path to write a report file. |
format |
Output format when |
include_timestamp |
Logical. Should a creation timestamp be included? |
overwrite |
Logical. Should an existing |
max_table_rows |
Maximum number of rows shown per table in the written report. |
The function can also write a lightweight Markdown or HTML file without adding heavy reporting dependencies.
A list of class "gazepoint_biometrics_report" with overview,
sections, tables, objects, output_file, and settings.
df <- data.frame( CNT = 1:5, GSR = c(1, 1.1, 1.2, 1.1, 1), HR = c(70, 71, 72, 71, 70), DIAL = c(40, 42, 44, 43, 41) ) report <- create_gazepoint_biometrics_report(df) names(report)df <- data.frame( CNT = 1:5, GSR = c(1, 1.1, 1.2, 1.1, 1), HR = c(70, 71, 72, 71, 70), DIAL = c(40, 42, 44, 43, 41) ) report <- create_gazepoint_biometrics_report(df) names(report)
Creates compact report-ready tables from a Gazepoint Biometrics workflow object or from separate workflow components. The function does not write files. It returns cleaned tables that can be printed, exported, or inserted into reports and supplementary materials.
create_gazepoint_biometrics_report_tables( workflow = NULL, validation = NULL, quality = NULL, sampling = NULL, diagnostics = NULL, exclusion_recommendations = NULL, ttl_events = NULL, max_ttl_events = 20 )create_gazepoint_biometrics_report_tables( workflow = NULL, validation = NULL, quality = NULL, sampling = NULL, diagnostics = NULL, exclusion_recommendations = NULL, ttl_events = NULL, max_ttl_events = 20 )
workflow |
Optional workflow object produced by
|
validation |
Optional validation object produced by
|
quality |
Optional quality-audit table. |
sampling |
Optional sampling/timing audit table produced by
|
diagnostics |
Optional diagnostic table produced by
|
exclusion_recommendations |
Optional object produced by
|
ttl_events |
Optional TTL event table produced by
|
max_ttl_events |
Maximum number of TTL events to include in the compact TTL event table. |
A list of report-ready tables.
Creates a column-level dictionary from a data frame or from CSV file headers. The output is intended for reporting and reproducibility documentation.
create_gazepoint_dictionary( data = NULL, file_paths = NULL, units = NULL, descriptions = NULL, required_cols = NULL, write_path = NULL )create_gazepoint_dictionary( data = NULL, file_paths = NULL, units = NULL, descriptions = NULL, required_cols = NULL, write_path = NULL )
data |
Optional data frame. |
file_paths |
Optional character vector of CSV files to inspect when
|
units |
Optional named character vector or named list mapping columns to units. |
descriptions |
Optional named character vector or named list mapping columns to descriptions. |
required_cols |
Optional character vector of columns expected in the data. |
write_path |
Optional output path. Use |
A data frame with class gazepoint_dictionary.
Creates a structured six-phase analysis pipeline for Gazepoint
Biometrics EDA/GSR workflows. The helper maps each phase to native
gpbiometrics functions, optional external-method bridges, and optional
downstream model templates for brms and lme4.
create_gazepoint_eda_analysis_pipeline( include_external_bridges = TRUE, include_model_templates = TRUE, include_reporting_guidance = TRUE, style = c("compact", "detailed") )create_gazepoint_eda_analysis_pipeline( include_external_bridges = TRUE, include_model_templates = TRUE, include_reporting_guidance = TRUE, style = c("compact", "detailed") )
include_external_bridges |
Logical. If |
include_model_templates |
Logical. If |
include_reporting_guidance |
Logical. If |
style |
Output style. |
This function does not fit statistical models, does not run external software, and does not infer emotion, valence, stress, trust, preference, cognition, or diagnosis. It is a reproducible planning and reporting aid.
A list with overview, phases, function_map,
model_templates, reporting_guidance, interpretation_guardrails, and
settings.
Create reproducible Gazepoint eye-tracking methods text
create_gazepoint_eye_methods_text( sampling_rate_hz, device_model = "Gazepoint GP3", calibration_points = 9L, binocular = TRUE, software = "Gazepoint Analysis", screen_resolution = NULL, viewing_distance_cm = NULL, coordinate_space = NULL, preprocessing = NULL, fixation_detection = NULL, aoi_definition = NULL, synchronization = NULL, exclusions = NULL, tense = c("past", "future"), include_package_version = TRUE )create_gazepoint_eye_methods_text( sampling_rate_hz, device_model = "Gazepoint GP3", calibration_points = 9L, binocular = TRUE, software = "Gazepoint Analysis", screen_resolution = NULL, viewing_distance_cm = NULL, coordinate_space = NULL, preprocessing = NULL, fixation_detection = NULL, aoi_definition = NULL, synchronization = NULL, exclusions = NULL, tense = c("past", "future"), include_package_version = TRUE )
sampling_rate_hz |
Recording frequency. |
device_model |
Device model. |
calibration_points |
Number of calibration points. |
binocular |
Whether binocular data were recorded. |
software |
Optional acquisition software. |
screen_resolution |
Optional width-height pixel vector. |
viewing_distance_cm |
Optional viewing distance. |
coordinate_space |
Optional coordinate description. |
preprocessing |
Optional preprocessing descriptions. |
fixation_detection |
Optional fixation-detection description. |
aoi_definition |
Optional AOI description. |
synchronization |
Optional synchronization description. |
exclusions |
Optional exclusion description. |
tense |
|
include_package_version |
Include the gpbiometrics version. |
A character object of class "gazepoint_eye_methods_text".
Create HeartPy-style report tables for Gazepoint pulse/PPG data
create_gazepoint_heartpy_report( detection, output_dir = NULL, prefix = "gazepoint_heartpy" )create_gazepoint_heartpy_report( detection, output_dir = NULL, prefix = "gazepoint_heartpy" )
detection |
Detection object returned by detect_gazepoint_ppg_peaks(). |
output_dir |
Optional output directory. If NULL, no files are written. |
prefix |
File prefix when output_dir is supplied. |
A list with peaks, measures, diagnostics, and paths.
Generate conservative, manuscript-ready methods text from available Gazepoint workflow objects. The function reports workflow structure and audit coverage only; it does not infer emotion, stress, cognition, preference, diagnosis, mechanism, or exact temporal onset from biometric or gaze-linked signals.
create_gazepoint_methods_section( export_profile = NULL, design_audit = NULL, event_audit = NULL, condition_audit = NULL, decision_log = NULL, package_version = as.character(utils::packageVersion("gpbiometrics")), validation = NULL, include_guardrails = TRUE )create_gazepoint_methods_section( export_profile = NULL, design_audit = NULL, event_audit = NULL, condition_audit = NULL, decision_log = NULL, package_version = as.character(utils::packageVersion("gpbiometrics")), validation = NULL, include_guardrails = TRUE )
export_profile |
Optional object from |
design_audit |
Optional object from |
event_audit |
Optional object from |
condition_audit |
Optional object from |
decision_log |
Optional object from |
package_version |
Package version to report. Defaults to the installed gpbiometrics version. |
validation |
Optional named list with validation entries, for example
|
include_guardrails |
Logical. If |
A character vector with class "gazepoint_report_text".
log <- create_gazepoint_analysis_decision_log(study_id = "demo") create_gazepoint_methods_section(decision_log = log)log <- create_gazepoint_analysis_decision_log(study_id = "demo") create_gazepoint_methods_section(decision_log = log)
Creates a lightweight tabular representation of a Gazepoint analysis pipeline. The output contains workflow nodes and directed edges that can be audited or exported as DOT/Graphviz text. This function is intended for documentation, reporting, and reproducibility only.
create_gazepoint_pipeline_map( steps = NULL, edges = NULL, pipeline_id = NULL, include_default = TRUE )create_gazepoint_pipeline_map( steps = NULL, edges = NULL, pipeline_id = NULL, include_default = TRUE )
steps |
Optional data frame of pipeline steps. Required column:
|
edges |
Optional data frame of directed edges with columns |
pipeline_id |
Optional pipeline identifier. |
include_default |
Logical. If |
A list with class gazepoint_pipeline_map.
Creates a structured checklist for preregistration and reviewer-readiness documentation. The checklist is descriptive only: it helps users document design, preprocessing, QC, exclusions, outcomes, and reporting decisions. It does not judge scientific validity, remove data, or make biometric, psychological, diagnostic, or clinical claims.
create_gazepoint_preregistration_checklist( study_id = NULL, include_optional = TRUE, custom_items = NULL )create_gazepoint_preregistration_checklist( study_id = NULL, include_optional = TRUE, custom_items = NULL )
study_id |
Optional study identifier added to the checklist. |
include_optional |
Logical. If |
custom_items |
Optional data frame of additional checklist items. It may
contain columns |
A data frame with class gazepoint_preregistration_checklist.
Creates a cautious preregistration template for Gazepoint Biometrics EDA/GSR workflows.
create_gazepoint_preregistration_template( study_title = "Gazepoint biometrics study", signal_standardization = c("within_participant_z", "range_correction", "none"), artifact_rules = c("kleckner_style", "custom", "none"), eda_min_us = 0.01, eda_max_us = 100, rapid_change_threshold = 20, output_file = NULL )create_gazepoint_preregistration_template( study_title = "Gazepoint biometrics study", signal_standardization = c("within_participant_z", "range_correction", "none"), artifact_rules = c("kleckner_style", "custom", "none"), eda_min_us = 0.01, eda_max_us = 100, rapid_change_threshold = 20, output_file = NULL )
study_title |
Study title. |
signal_standardization |
Standardization plan. |
artifact_rules |
Artifact-rule description. |
eda_min_us |
Minimum conductance threshold. |
eda_max_us |
Maximum conductance threshold. |
rapid_change_threshold |
Maximum absolute percent change per second. |
output_file |
Optional path to write the template as a text file. |
A character string.
Create PsPM-style convolution GLM design matrix
create_gazepoint_pspm_glm_design( events, time, time_col = NULL, onset_col = "onset_time_s", condition_col = "condition", duration_col = NULL, response = c("scr", "canonical", "boxcar"), response_length_s = 20, include_derivative = FALSE, add_intercept = TRUE )create_gazepoint_pspm_glm_design( events, time, time_col = NULL, onset_col = "onset_time_s", condition_col = "condition", duration_col = NULL, response = c("scr", "canonical", "boxcar"), response_length_s = 20, include_derivative = FALSE, add_intercept = TRUE )
events |
Event table. |
time |
Numeric time vector or data frame containing time_col. |
time_col |
Time column if time is a data frame. |
onset_col |
Event onset column. |
condition_col |
Event condition column. |
duration_col |
Optional duration column. |
response |
Response kernel: scr, canonical, or boxcar. |
response_length_s |
Kernel length in seconds. |
include_derivative |
If TRUE, include temporal derivative regressors. |
add_intercept |
If TRUE, add intercept column. |
Design matrix as data frame.
Create a time vector from NN intervals
create_gazepoint_pyhrv_time_vector(nni_ms, start_s = 0)create_gazepoint_pyhrv_time_vector(nni_ms, start_s = 0)
nni_ms |
Numeric NN intervals in milliseconds. |
start_s |
Start time in seconds. |
Numeric time vector in seconds.
Generate a compact reviewer-facing quality-control supplement from available export-profile, design-audit, event-audit, condition-balance, and decision-log objects.
create_gazepoint_qc_supplement( export_profile = NULL, design_audit = NULL, event_audit = NULL, condition_audit = NULL, decision_log = NULL, title = "Gazepoint workflow quality-control supplement" )create_gazepoint_qc_supplement( export_profile = NULL, design_audit = NULL, event_audit = NULL, condition_audit = NULL, decision_log = NULL, title = "Gazepoint workflow quality-control supplement" )
export_profile |
Optional object from |
design_audit |
Optional object from |
event_audit |
Optional object from |
condition_audit |
Optional object from |
decision_log |
Optional object from |
title |
Section title. |
A character vector with class "gazepoint_report_text".
Combines audit, missingness, synchronization, and event-locked summary objects
into a reviewer-friendly quality dashboard. If output_dir is supplied, core
dashboard tables are exported as CSV/text files.
create_gazepoint_quality_dashboard( data = NULL, audit = NULL, missingness = NULL, alignment = NULL, eventlocked = NULL, title = "Gazepoint quality dashboard", output_dir = NULL )create_gazepoint_quality_dashboard( data = NULL, audit = NULL, missingness = NULL, alignment = NULL, eventlocked = NULL, title = "Gazepoint quality dashboard", output_dir = NULL )
data |
Optional data frame used to compute audit and missingness when explicit objects are not supplied. |
audit |
Optional object from |
missingness |
Optional object from |
alignment |
Optional object from |
eventlocked |
Optional object from
|
title |
Dashboard title. |
output_dir |
Optional directory where dashboard tables are written. |
Object of class gazepoint_quality_dashboard.
Creates a conservative release checklist. If an audit table is supplied, each checklist item is linked to the current audit status. The checklist is meant to support human review before tagging or submission.
create_gazepoint_release_checklist(audit = NULL, include_optional = TRUE)create_gazepoint_release_checklist(audit = NULL, include_optional = TRUE)
audit |
Optional audit data frame or |
include_optional |
Logical. If |
A data frame with release checklist items.
Generate a compact reproducibility statement for manuscripts, supplements, or reviewer responses.
create_gazepoint_reproducibility_statement( decision_log = NULL, package_version = as.character(utils::packageVersion("gpbiometrics")), repository_url = NA_character_, validation = NULL, data_statement = NA_character_, include_guardrails = TRUE )create_gazepoint_reproducibility_statement( decision_log = NULL, package_version = as.character(utils::packageVersion("gpbiometrics")), repository_url = NA_character_, validation = NULL, data_statement = NA_character_, include_guardrails = TRUE )
decision_log |
Optional object from |
package_version |
Package version to report. |
repository_url |
Optional repository URL. |
validation |
Optional named list with validation entries. |
data_statement |
Optional text describing data availability or synthetic demonstration status. |
include_guardrails |
Logical. If |
A character vector with class "gazepoint_report_text".
Creates a simple tabular template for dataset, export, device, timing, and processing metadata. The output can be written by the user as CSV/TSV/JSON outside this function. This function does not perform full BIDS conversion.
create_gazepoint_sidecar_template( dataset_id = NULL, export_type = NULL, include_optional = TRUE, custom_fields = NULL )create_gazepoint_sidecar_template( dataset_id = NULL, export_type = NULL, include_optional = TRUE, custom_fields = NULL )
dataset_id |
Optional dataset identifier. |
export_type |
Optional export type label, such as |
include_optional |
Logical. If |
custom_fields |
Optional data frame with columns |
A data frame with class gazepoint_sidecar_template.
Prepares a long-format trial table by joining stimulus/event design information with event-window summaries from numeric Gazepoint channels. The output is intended for downstream GLM, LMM, or mixed-model workflows.
create_gazepoint_trial_regressors( data, design, pre = 0, post = 5, time_col = NULL, event_time_col = NULL, event_id_col = NULL, signal_cols = NULL, subject_col = NULL, design_subject_col = NULL, carry_design_cols = NULL )create_gazepoint_trial_regressors( data, design, pre = 0, post = 5, time_col = NULL, event_time_col = NULL, event_id_col = NULL, signal_cols = NULL, subject_col = NULL, design_subject_col = NULL, carry_design_cols = NULL )
data |
Data frame containing time-series signals, or a list of data frames. |
design |
Numeric event timestamps, a design data frame, or a list with
an |
pre |
Seconds before event onset to summarize. |
post |
Seconds after event onset to summarize. |
time_col |
Time column in |
event_time_col |
Event-time column in |
event_id_col |
Trial/event identifier column in |
signal_cols |
Numeric signal columns to summarize. If NULL, all numeric columns except the time column are used. |
subject_col |
Optional subject/participant column in |
design_subject_col |
Optional subject/participant column in |
carry_design_cols |
Design columns to carry into the output. If NULL, all non-time design columns are carried. |
A data frame with one row per trial/event and signal summary regressors.
dat <- data.frame(time_s = seq(0, 10, by = 1), GSR = seq(0, 1, length.out = 11)) design <- data.frame(trial = "T1", onset = 5, condition = "A") create_gazepoint_trial_regressors(dat, design, pre = 1, post = 2)dat <- data.frame(time_s = seq(0, 10, by = 1), GSR = seq(0, 1, length.out = 11)) design <- data.frame(trial = "T1", onset = 5, condition = "A") create_gazepoint_trial_regressors(dat, design, pre = 1, post = 2)
Creates descriptive tonic and phasic EDA columns from Gazepoint GSR/EDA data.
If vendor-provided tonic/phasic columns such as GSR_US_TONIC and
GSR_US_PHASIC are available, they are used by default. Otherwise, a simple
rolling-median tonic estimate is used and the phasic component is calculated
as signal minus tonic. This helper is intentionally conservative and does not
replace specialised biosignal-processing software.
decompose_gazepoint_eda( data, signal_col = NULL, tonic_col = NULL, phasic_col = NULL, time_col = NULL, group_cols = NULL, window_size = 31L, output_prefix = "eda", overwrite = FALSE )decompose_gazepoint_eda( data, signal_col = NULL, tonic_col = NULL, phasic_col = NULL, time_col = NULL, group_cols = NULL, window_size = 31L, output_prefix = "eda", overwrite = FALSE )
data |
A data frame. |
signal_col |
Optional GSR/EDA signal column. If |
tonic_col |
Optional existing tonic column. |
phasic_col |
Optional existing phasic column. |
time_col |
Optional time/order column. |
group_cols |
Optional grouping columns. |
window_size |
Rolling-median window size used when existing tonic/phasic columns are not available. Even values are increased by one. |
output_prefix |
Prefix for output columns. |
overwrite |
Logical. Should existing output columns be overwritten? |
A data frame with added tonic, phasic, and method columns. Attributes
include overview and settings.
df <- data.frame(CNT = 1:10, GSR_US = seq(1, 2, length.out = 10)) out <- decompose_gazepoint_eda(df, signal_col = "GSR_US", window_size = 3) names(out)df <- data.frame(CNT = 1:10, GSR_US = seq(1, 2, length.out = 10)) out <- decompose_gazepoint_eda(df, signal_col = "GSR_US", window_size = 3) names(out)
Applies a user-supplied reconstruction function or model to fixed-length EDA windows. No pretrained neural network is bundled. This function is an interoperability bridge for validated user-supplied autoencoders.
denoise_gazepoint_eda_autoencoder( dat, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, model = NULL, window_samples = 128, output_col = NULL, overwrite = FALSE )denoise_gazepoint_eda_autoencoder( dat, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, model = NULL, window_samples = 128, output_col = NULL, overwrite = FALSE )
dat |
A data frame. |
eda_col |
Numeric EDA column. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
model |
A user-supplied function or model. If |
window_samples |
Window length in samples. |
output_col |
Optional output column. |
overwrite |
Logical. If |
A data frame with reconstructed signal and denoising attributes.
Applies simple Haar wavelet soft-threshold denoising to EDA signals within optional groups. This is a dependency-light wavelet denoising helper and should not be described as an exact reproduction of stationary-wavelet artifact-removal algorithms.
denoise_gazepoint_eda_wavelet( dat, eda_col = "GSR_US", group_cols = NULL, output_col = NULL, levels = 3, threshold_multiplier = 1, overwrite = FALSE )denoise_gazepoint_eda_wavelet( dat, eda_col = "GSR_US", group_cols = NULL, output_col = NULL, levels = 3, threshold_multiplier = 1, overwrite = FALSE )
dat |
A data frame containing EDA data. |
eda_col |
EDA/conductance column. |
group_cols |
Optional grouping columns. |
output_col |
Optional output column. |
levels |
Number of Haar decomposition levels. |
threshold_multiplier |
Multiplier applied to the robust noise estimate. |
overwrite |
Logical. If |
A data frame with denoised EDA and denoising attributes.
Applies a user-supplied reconstruction function or model to fixed-length PPG windows. No pretrained neural network is bundled. This function is an interoperability bridge for validated user-supplied autoencoders.
denoise_gazepoint_ppg_autoencoder( dat, ppg_col = "HRP", time_col = NULL, group_cols = NULL, model = NULL, window_samples = 128, output_col = NULL, overwrite = FALSE )denoise_gazepoint_ppg_autoencoder( dat, ppg_col = "HRP", time_col = NULL, group_cols = NULL, model = NULL, window_samples = 128, output_col = NULL, overwrite = FALSE )
dat |
A data frame. |
ppg_col |
Numeric PPG/pulse column. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
model |
A user-supplied function or model. If |
window_samples |
Window length in samples. |
output_col |
Optional output column. |
overwrite |
Logical. If |
A data frame with reconstructed signal and denoising attributes.
Adds uniform white noise with magnitude tied to hardware resolution. This is intended only for nonlinear phase-space methods that are sensitive to exact repeated values caused by coarse interval quantization.
denoise_gazepoint_quantization_noise( dat, signal_cols, resolution, group_cols = NULL, output_suffix = "_quantization_jittered", seed = NULL, overwrite = FALSE )denoise_gazepoint_quantization_noise( dat, signal_cols, resolution, group_cols = NULL, output_suffix = "_quantization_jittered", seed = NULL, overwrite = FALSE )
dat |
A data frame. |
signal_cols |
Numeric signal columns to jitter. |
resolution |
Numeric scalar or named numeric vector giving measurement resolution for each column. |
group_cols |
Optional grouping columns, retained in settings. |
output_suffix |
Suffix for jittered columns. |
seed |
Optional random seed. |
overwrite |
Logical. If |
A data frame with jittered columns and quantization-noise attributes.
Detects whether GSR/EDA, heart-rate, engagement-dial, and TTL channels are
present and whether they appear active. A channel can be present but inactive
when validity flags are zero or the signal contains only zeros or missing
values. For each signal family, summary_column identifies the primary
column used for the reported minimum and maximum values.
detect_active_biometric_channels(data)detect_active_biometric_channels(data)
data |
A data frame imported from a Gazepoint export. |
A data frame with one row per signal family.
Detects likely biometric, timing, marker, and identifying columns in a Gazepoint Biometrics export. The function is deliberately descriptive. It reports what appears to be present and active, but it does not infer emotion, valence, or HRV from ambiguous raw columns.
detect_gazepoint_biometric_schema(data)detect_gazepoint_biometric_schema(data)
data |
A data frame. |
A list with overview, columns, time_columns, timebase,
name_map, and notes.
df <- data.frame( CNT = 1:5, TIME = seq(0, by = 1 / 60, length.out = 5), GSR = c(100, 101, 102, 101, 100), HR = c(70, 71, 72, 71, 70), HRV = c(1, 1, 1, 1, 1) ) detect_gazepoint_biometric_schema(df)df <- data.frame( CNT = 1:5, TIME = seq(0, by = 1 / 60, length.out = 5), GSR = c(100, 101, 102, 101, 100), HR = c(70, 71, 72, 71, 70), HRV = c(1, 1, 1, 1, 1) ) detect_gazepoint_biometric_schema(df)
Inspects timing and counter columns and returns a conservative summary of the likely primary timebase. Sampling rate is estimated only when numeric timing information is available and intervals are positive.
detect_gazepoint_biometric_timebase(data, time_col = NULL, counter_col = NULL)detect_gazepoint_biometric_timebase(data, time_col = NULL, counter_col = NULL)
data |
A data frame. |
time_col |
Optional explicit timing column. |
counter_col |
Optional explicit counter column. |
A list with overview, time_columns, interval_summary, and
warnings.
df <- data.frame(CNT = 1:5, TIME = seq(0, by = 1 / 60, length.out = 5)) detect_gazepoint_biometric_timebase(df)df <- data.frame(CNT = 1:5, TIME = seq(0, by = 1 / 60, length.out = 5)) detect_gazepoint_biometric_timebase(df)
Detects likely blink or pupil-dropout samples in Gazepoint pupil columns using transparent, rule-based criteria. The function flags non-finite values, values outside a plausible pupil range, and optionally large sample-to-sample changes. It does not infer attention, cognition, arousal, emotion, or visual processing from the pupil signal.
detect_gazepoint_blinks( data, pupil_cols = NULL, id_cols = NULL, min_pupil = 0, max_pupil = Inf, change_threshold = NULL, extend_samples = 0L, mask = TRUE, flag_suffix = "_blink_flag", clean_suffix = "_blink_clean" )detect_gazepoint_blinks( data, pupil_cols = NULL, id_cols = NULL, min_pupil = 0, max_pupil = Inf, change_threshold = NULL, extend_samples = 0L, mask = TRUE, flag_suffix = "_blink_flag", clean_suffix = "_blink_clean" )
data |
A data frame containing Gazepoint pupil data. |
pupil_cols |
Character vector naming pupil columns. If |
id_cols |
Optional character vector naming grouping columns. Blink detection based on sample-to-sample change is applied within groups. |
min_pupil |
Minimum plausible pupil value. Values less than or equal to
this threshold are flagged. Use |
max_pupil |
Maximum plausible pupil value. Values greater than or equal
to this threshold are flagged. Use |
change_threshold |
Optional maximum plausible absolute sample-to-sample
change. Use |
extend_samples |
Non-negative integer. Number of neighbouring samples on each side of a detected blink/dropout to also flag. |
mask |
Logical. If |
flag_suffix |
Suffix appended to pupil-column names for logical flag columns. |
clean_suffix |
Suffix appended to pupil-column names for cleaned columns
when |
A list with the processed data, a summary table, rule settings, and
warnings. The object has class "gazepoint_blink_audit".
d <- data.frame( participant = rep("P01", 8), time = seq_len(8), pupil_left = c(3.1, 3.2, 0, 3.2, 8.5, 3.1, NA, 3.0) ) detect_gazepoint_blinks(d, pupil_cols = "pupil_left")d <- data.frame( participant = rep("P01", 8), time = seq_len(8), pupil_left = c(3.1, 3.2, 0, 3.2, 8.5, 3.1, NA, 3.0) ) detect_gazepoint_blinks(d, pupil_cols = "pupil_left")
Detects abrupt changes in noisy biological time series using a dependency-light stochastic rolling-window approximation. The score combines adjacent-window changes in mean and variance with a robust adaptive threshold.
detect_gazepoint_doubly_stochastic_changepoints( dat, signal_col, time_col = "CNT", group_cols = NULL, window_seconds = 10, step_seconds = 2, threshold_mad_multiplier = 6, min_distance_s = 5 )detect_gazepoint_doubly_stochastic_changepoints( dat, signal_col, time_col = "CNT", group_cols = NULL, window_seconds = 10, step_seconds = 2, threshold_mad_multiplier = 6, min_distance_s = 5 )
dat |
A data frame. |
signal_col |
Numeric signal column. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns. |
window_seconds |
Window length in seconds. |
step_seconds |
Step size in seconds. |
threshold_mad_multiplier |
Robust threshold multiplier. |
min_distance_s |
Minimum distance between detected change points. |
This is not a full reproduction of any specific doubly stochastic model. It is a transparent approximation for QC and exploratory segmentation.
A list with overview, score_table, changepoints, and settings.
Applies a transparent velocity-threshold classification to raw Gazepoint gaze coordinates. Samples are classified as fixation, saccade, unclassified, or invalid, after which fixation- and saccade-level event tables are derived.
detect_gazepoint_fixations( data, time_col = NULL, x_col = NULL, y_col = NULL, group_cols = NULL, valid_col = NULL, valid_values = c(1, TRUE), time_unit = c("seconds", "milliseconds", "microseconds", "samples"), sampling_rate_hz = NULL, coordinate_unit = c("native", "normalized", "pixels", "degrees"), velocity_threshold, min_fixation_duration_ms = 100, min_saccade_duration_ms = 10, max_gap_ms = 100, velocity_col = "gaze_velocity", class_col = "gaze_class", event_id_col = "gaze_event_id", overwrite = FALSE )detect_gazepoint_fixations( data, time_col = NULL, x_col = NULL, y_col = NULL, group_cols = NULL, valid_col = NULL, valid_values = c(1, TRUE), time_unit = c("seconds", "milliseconds", "microseconds", "samples"), sampling_rate_hz = NULL, coordinate_unit = c("native", "normalized", "pixels", "degrees"), velocity_threshold, min_fixation_duration_ms = 100, min_saccade_duration_ms = 10, max_gap_ms = 100, velocity_col = "gaze_velocity", class_col = "gaze_class", event_id_col = "gaze_event_id", overwrite = FALSE )
data |
A data frame containing sample-level gaze coordinates. |
time_col |
Numeric time column. If |
x_col |
Numeric horizontal gaze-coordinate column. If |
y_col |
Numeric vertical gaze-coordinate column. If |
group_cols |
Optional participant, trial, session, or file columns. Detection is performed independently within each group. |
valid_col |
Optional gaze-validity column. |
valid_values |
Values in |
time_unit |
Unit of |
sampling_rate_hz |
Sampling rate required when
|
coordinate_unit |
Descriptive unit of the gaze coordinates:
|
velocity_threshold |
Positive velocity threshold expressed in coordinate units per second. Samples above this threshold are classified as saccadic. |
min_fixation_duration_ms |
Minimum fixation duration in milliseconds.
Shorter fixation runs are labelled |
min_saccade_duration_ms |
Minimum saccade duration in milliseconds.
Shorter saccade runs are labelled |
max_gap_ms |
Maximum permitted time difference between adjacent samples.
Larger gaps split events. Set to |
velocity_col |
Name of the generated sample-velocity column. |
class_col |
Name of the generated sample-classification column. |
event_id_col |
Name of the generated sample event-ID column. |
overwrite |
Logical. If |
This is an I-VT-style detector rather than an exact reproduction of a specific vendor or external-toolbox implementation. The velocity threshold must match the supplied coordinate unit and should be justified, reported, and sensitivity-checked for the recording design.
An object of class "gazepoint_gaze_events" containing:
samples: original rows with velocity, class, and event ID;
fixations: fixation-level timing, location, and dispersion summaries;
saccades: saccade-level timing, amplitude, direction, and velocity;
summary: group-level sample and event counts;
settings: complete detector settings.
Salvucci, D. D., and Goldberg, J. H. (2000). Identifying fixations and saccades in eye-tracking protocols. Proceedings of the Eye Tracking Research and Applications Symposium.
detect_gazepoint_saccades(),
plot_gazepoint_saccade_main_sequence(),
summarize_gazepoint_fixations()
gaze <- data.frame( time_s = seq(0, 0.9, by = 0.1), gaze_x = c(0, 0.01, 0.02, 0.03, 1, 1.01, 1.02, 1.03, 1.04, 1.05), gaze_y = 0 ) events <- detect_gazepoint_fixations( gaze, time_col = "time_s", x_col = "gaze_x", y_col = "gaze_y", velocity_threshold = 2, min_fixation_duration_ms = 100, min_saccade_duration_ms = 50 ) events$fixations events$saccadesgaze <- data.frame( time_s = seq(0, 0.9, by = 0.1), gaze_x = c(0, 0.01, 0.02, 0.03, 1, 1.01, 1.02, 1.03, 1.04, 1.05), gaze_y = 0 ) events <- detect_gazepoint_fixations( gaze, time_col = "time_s", x_col = "gaze_x", y_col = "gaze_y", velocity_threshold = 2, min_fixation_duration_ms = 100, min_saccade_duration_ms = 50 ) events$fixations events$saccades
Flags long missing, zero, constant, or low-variance runs in selected signal columns. The function is intended for quality control and audit reporting only. It does not remove samples and does not make physiological, psychological, diagnostic, or clinical claims.
detect_gazepoint_nonwear( data, signal_cols, group_cols = NULL, time_col = NULL, min_run_length = 10, zero_tolerance = 0, constant_tolerance = 0, low_variance_threshold = NULL, detect_missing = TRUE, detect_zero = TRUE, detect_constant = TRUE, detect_low_variance = TRUE )detect_gazepoint_nonwear( data, signal_cols, group_cols = NULL, time_col = NULL, min_run_length = 10, zero_tolerance = 0, constant_tolerance = 0, low_variance_threshold = NULL, detect_missing = TRUE, detect_zero = TRUE, detect_constant = TRUE, detect_low_variance = TRUE )
data |
A data frame. |
signal_cols |
Character vector of numeric signal columns to inspect. |
group_cols |
Optional character vector of grouping columns, such as participant, trial, session, or condition. |
time_col |
Optional numeric time column used to report interval start and end times. |
min_run_length |
Minimum number of consecutive samples required for a run to be reported. |
zero_tolerance |
Absolute tolerance used when detecting zero-valued runs. |
constant_tolerance |
Absolute adjacent-difference tolerance used when detecting constant runs. |
low_variance_threshold |
Optional standard-deviation threshold for
low-variance windows. If |
detect_missing |
Logical. If |
detect_zero |
Logical. If |
detect_constant |
Logical. If |
detect_low_variance |
Logical. If |
A list with class gazepoint_nonwear_detection, containing
interval and summary tables.
Detect BioSPPy-style PPG pulse onsets
detect_gazepoint_ppg_onsets( data, signal_col = NULL, time_col = NULL, peaks = NULL, group_cols = NULL, sampling_rate_hz = NULL, search_seconds = 0.6 )detect_gazepoint_ppg_onsets( data, signal_col = NULL, time_col = NULL, peaks = NULL, group_cols = NULL, sampling_rate_hz = NULL, search_seconds = 0.6 )
data |
Data frame or numeric PPG/BVP signal. |
signal_col |
PPG/BVP column. |
time_col |
Optional time column. |
peaks |
Optional peak table or peak indices. |
group_cols |
Optional grouping columns. |
sampling_rate_hz |
Sampling rate in Hz. |
search_seconds |
Seconds before peak used to find onset. |
Data frame of onsets.
Detect HeartPy-style pulse/PPG peaks in Gazepoint exports
detect_gazepoint_ppg_peaks( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, bpm_min = 40, bpm_max = 180, moving_average_seconds = 0.75, threshold_offsets = seq(-0.25, 1.25, by = 0.05), reconstruct_clipping = TRUE, enhance_peaks = FALSE, lowpass_hz = NULL, hampel = FALSE, high_precision = TRUE )detect_gazepoint_ppg_peaks( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, bpm_min = 40, bpm_max = 180, moving_average_seconds = 0.75, threshold_offsets = seq(-0.25, 1.25, by = 0.05), reconstruct_clipping = TRUE, enhance_peaks = FALSE, lowpass_hz = NULL, hampel = FALSE, high_precision = TRUE )
data |
Data frame or numeric signal. |
signal_col |
Signal column when data is a data frame. |
time_col |
Optional time column in seconds. |
group_cols |
Optional grouping columns. |
sampling_rate_hz |
Sampling rate in Hz. |
bpm_min |
Minimum plausible BPM. |
bpm_max |
Maximum plausible BPM. |
moving_average_seconds |
Moving-average half-window scale used for thresholding. |
threshold_offsets |
Candidate threshold offsets in signal SD units. |
reconstruct_clipping |
Whether to reconstruct clipped peaks. |
enhance_peaks |
Whether to run peak enhancement. |
lowpass_hz |
Optional low-pass cutoff. |
hampel |
Whether to apply Hampel correction. |
high_precision |
Whether to refine peak timing by local spline upsampling. |
A list with peaks, processed_signal, settings, and diagnostics.
Identifies blink-like intervals as runs of missing, zero, non-finite, or invalid pupil samples. For binocular data, the default treats a blink as a sample where all selected pupil channels are invalid.
detect_gazepoint_pupil_blinks( data, pupil_cols = NULL, time_col = NULL, group_cols = NULL, validity_cols = NULL, invalid_values = c(0), nonpositive_is_missing = TRUE, combine = c("all", "any"), min_blink_samples = 1L, return = c("intervals", "onsets", "flags") )detect_gazepoint_pupil_blinks( data, pupil_cols = NULL, time_col = NULL, group_cols = NULL, validity_cols = NULL, invalid_values = c(0), nonpositive_is_missing = TRUE, combine = c("all", "any"), min_blink_samples = 1L, return = c("intervals", "onsets", "flags") )
data |
Eye-tracking data frame. |
pupil_cols |
Pupil columns. If NULL, common Gazepoint names such as
|
time_col |
Time column. If NULL, common Gazepoint time columns are detected automatically. |
group_cols |
Optional grouping columns, such as participant or trial. |
validity_cols |
Optional validity columns corresponding to
|
invalid_values |
Numeric values treated as missing pupil samples. |
nonpositive_is_missing |
If TRUE, pupil values less than or equal to zero are treated as invalid. |
combine |
Whether a blink requires |
min_blink_samples |
Minimum run length in samples. |
return |
Return |
A data frame of blink intervals by default. If return = "onsets",
a numeric vector of blink onset times is returned. If return = "flags",
a logical vector marking blink samples is returned.
dat <- data.frame(time_s = 0:4, LPD = c(3, NA, NA, 3.1, 3.2)) detect_gazepoint_pupil_blinks(dat, pupil_cols = "LPD", time_col = "time_s")dat <- data.frame(time_s = 0:4, LPD = c(3, NA, NA, 3.1, 3.2)) detect_gazepoint_pupil_blinks(dat, pupil_cols = "LPD", time_col = "time_s")
Convenience wrapper around detect_gazepoint_fixations() that returns only
the saccade-level event table. Detector settings and group summaries are
retained as attributes.
detect_gazepoint_saccades(...)detect_gazepoint_saccades(...)
... |
Additional arguments passed to
|
A data frame with class "gazepoint_detected_saccades" containing
saccade timing, amplitude, direction, and velocity measures.
gaze <- data.frame( time_s = seq(0, 0.9, by = 0.1), gaze_x = c(0, 0.01, 0.02, 0.03, 1, 1.01, 1.02, 1.03, 1.04, 1.05), gaze_y = 0 ) detect_gazepoint_saccades( gaze, time_col = "time_s", x_col = "gaze_x", y_col = "gaze_y", velocity_threshold = 2, min_saccade_duration_ms = 50 )gaze <- data.frame( time_s = seq(0, 0.9, by = 0.1), gaze_x = c(0, 0.01, 0.02, 0.03, 1, 1.01, 1.02, 1.03, 1.04, 1.05), gaze_y = 0 ) detect_gazepoint_saccades( gaze, time_col = "time_s", x_col = "gaze_x", y_col = "gaze_y", velocity_threshold = 2, min_saccade_duration_ms = 50 )
Detects simple SCR-like peaks from a phasic EDA signal. If a phasic column is
not supplied, the function first creates a descriptive phasic component using
decompose_gazepoint_eda(). This helper is intended for exploratory quality
control and descriptive summaries, not as a replacement for specialised SCR
detection pipelines.
detect_gazepoint_scr_events( data, phasic_col = NULL, signal_col = NULL, time_col = NULL, group_cols = NULL, threshold = NULL, min_peak_distance = 10L, window_size = 31L )detect_gazepoint_scr_events( data, phasic_col = NULL, signal_col = NULL, time_col = NULL, group_cols = NULL, threshold = NULL, min_peak_distance = 10L, window_size = 31L )
data |
A data frame. |
phasic_col |
Optional phasic EDA column. |
signal_col |
Optional raw/conductance EDA column used when |
time_col |
Optional time/order column. |
group_cols |
Optional grouping columns. |
threshold |
Optional numeric detection threshold. If |
min_peak_distance |
Minimum distance between retained peaks in samples. |
window_size |
Rolling-median window size used if decomposition is needed. |
A list with overview, events, group_summary, and settings.
df <- data.frame( CNT = 1:20, GSR_US_PHASIC = c(rep(0, 5), 0.2, 0.8, 0.2, rep(0, 12)) ) detect_gazepoint_scr_events(df, phasic_col = "GSR_US_PHASIC", time_col = "CNT")df <- data.frame( CNT = 1:20, GSR_US_PHASIC = c(rep(0, 5), 0.2, 0.8, 0.2, rep(0, 12)) ) detect_gazepoint_scr_events(df, phasic_col = "GSR_US_PHASIC", time_col = "CNT")
Detects candidate skin conductance responses (SCRs) from Gazepoint EDA/GSR
signals. The helper prefers a phasic channel such as GSR_US_PHASIC when
available, and otherwise falls back to a conductance-like signal such as
GSR_US. It returns explicit onset, peak, amplitude, rise-time, and
recovery-time fields for downstream event-window summaries and statistical
modelling.
detect_gazepoint_scr_peaks( data, signal_col = NULL, phasic_col = NULL, time_col = NULL, group_cols = NULL, prefer_vendor_phasic = TRUE, amplitude_min = 0.01, recovery_fraction = 0.5, smooth_width = 1, min_peak_distance = 1 )detect_gazepoint_scr_peaks( data, signal_col = NULL, phasic_col = NULL, time_col = NULL, group_cols = NULL, prefer_vendor_phasic = TRUE, amplitude_min = 0.01, recovery_fraction = 0.5, smooth_width = 1, min_peak_distance = 1 )
data |
A data frame containing Gazepoint biometric rows. |
signal_col |
Optional conductance-like signal column, typically
|
phasic_col |
Optional phasic EDA signal column, typically
|
time_col |
Optional time/counter column. If |
group_cols |
Optional grouping columns. If |
prefer_vendor_phasic |
Logical. If |
amplitude_min |
Minimum trough-to-peak amplitude required for a detected SCR. |
recovery_fraction |
Fraction of the peak amplitude used to define
recovery. The default |
smooth_width |
Optional odd integer moving-average width. Use |
min_peak_distance |
Minimum distance, in rows, allowed between retained
candidate peaks within each group. The default |
This is a conservative R-native peak detector. It is not a replacement for full model-based EDA decomposition tools such as Ledalab, PsPM, or cvxEDA.
A list with overview, peaks, group_summary, signal_summary,
and settings.
Detects likely timing and counter columns in Gazepoint Biometrics exports. The function reports candidate timing columns rather than assuming that any single time variable is always present or always measured in the same unit.
detect_gazepoint_time_columns(data)detect_gazepoint_time_columns(data)
data |
A data frame or a character vector of column names. |
A data frame with one row per detected time-related column.
detect_gazepoint_time_columns(c("CNT", "TIME_MS", "GSR", "HR"))detect_gazepoint_time_columns(c("CNT", "TIME_MS", "GSR", "HR"))
Detrend RRI/IBI intervals in windows
detrend_gazepoint_rri_window( rri_ms, time_s = NULL, window_seconds = 60, method = c("median", "mean", "linear") )detrend_gazepoint_rri_window( rri_ms, time_s = NULL, window_seconds = 60, method = c("median", "mean", "linear") )
rri_ms |
Numeric RRI/IBI intervals in milliseconds. |
time_s |
Optional time vector. |
window_seconds |
Window length for local trend. |
method |
mean, median, or linear. |
Data frame with original, trend, and detrended RRI.
Applies a lightweight generic detrending step to any numeric Gazepoint signal, either globally or within participant/trial groups. This is useful for slow drift in channels such as EDA, pupil size, PPG baseline, or temperature.
detrend_gazepoint_signal( data, signal_col = NULL, time_col = NULL, group_cols = NULL, method = c("linear", "mean", "median", "loess", "none"), span = 0.3, preserve_mean = FALSE, suffix = "_detrended" )detrend_gazepoint_signal( data, signal_col = NULL, time_col = NULL, group_cols = NULL, method = c("linear", "mean", "median", "loess", "none"), span = 0.3, preserve_mean = FALSE, suffix = "_detrended" )
data |
Data frame or numeric vector. |
signal_col |
Signal column for data-frame input. |
time_col |
Optional time column. If omitted, sample index is used. |
group_cols |
Optional grouping columns for within-group detrending. |
method |
Detrending method: |
span |
Span for LOESS detrending. |
preserve_mean |
If TRUE, add the mean trend back after removing drift. |
suffix |
Suffix for the detrended signal column. |
Data frame with added trend and detrended columns.
Creates a compact diagnostic readiness summary from a Gazepoint Biometrics workflow object. The function does not change or remove data. It returns a one-row decision table with pass/review/fail status and concise reasons.
diagnose_gazepoint_biometrics_workflow( workflow, require_gsr = TRUE, require_hr = TRUE, require_dial = FALSE, max_exclude_window_pct = 25, max_review_window_pct = 25 )diagnose_gazepoint_biometrics_workflow( workflow, require_gsr = TRUE, require_hr = TRUE, require_dial = FALSE, max_exclude_window_pct = 25, max_review_window_pct = 25 )
workflow |
A workflow object produced by
|
require_gsr |
Should GSR/EDA be required for a pass status? |
require_hr |
Should heart rate be required for a pass status? |
require_dial |
Should engagement dial be required for a pass status? |
max_exclude_window_pct |
Maximum acceptable percentage of excluded windows before the workflow is marked as fail. |
max_review_window_pct |
Maximum acceptable percentage of review windows before the workflow is marked as review. |
A one-row data frame with diagnostic status and reasons.
Performs high-level checks on the data structure and design assumptions used by the current cluster-permutation prototype.
diagnose_gazepoint_cluster_design( data, subject, condition, time, value = NULL, design = c("within", "between"), min_subjects = 10L )diagnose_gazepoint_cluster_design( data, subject, condition, time, value = NULL, design = c("within", "between"), min_subjects = 10L )
data |
A data frame. |
subject |
Participant identifier column. |
condition |
Condition column. |
time |
Time-bin column. |
value |
Optional numeric outcome column. |
design |
Design to diagnose. The current runner is designed for within-subject two-condition time-course data. |
min_subjects |
Minimum recommended number of participants. |
An object of class gazepoint_cluster_design_diagnostic.
Estimates lag and linear drift between matched timestamps or event markers. A fixed lag has a near-zero drift slope; a changing lag has a non-zero slope.
diagnose_gazepoint_sync_drift( reference, target = NULL, reference_time_col = NULL, target_time_col = NULL, max_pairs = NULL )diagnose_gazepoint_sync_drift( reference, target = NULL, reference_time_col = NULL, target_time_col = NULL, max_pairs = NULL )
reference |
Reference timestamps or data frame. |
target |
Target timestamps or data frame. |
reference_time_col |
Optional reference time column. |
target_time_col |
Optional target time column. |
max_pairs |
Optional maximum number of matched pairs. |
List with summary and lag_table.
Aggregates selected numeric gaze or biometric signals into fixed-width time bins. Processing can be performed independently within participant, trial, session, or other user-defined groups. Only occupied bins are returned; the function does not fabricate observations for empty periods.
downsample_gazepoint_data( data, time_col, signal_cols = NULL, group_cols = NULL, interval, method = c("mean", "median", "first", "last"), na_rm = TRUE, time_value = c("start", "center", "mean"), origin = NULL )downsample_gazepoint_data( data, time_col, signal_cols = NULL, group_cols = NULL, interval, method = c("mean", "median", "first", "last"), na_rm = TRUE, time_value = c("start", "center", "mean"), origin = NULL )
data |
A data frame containing a numeric time column and one or more numeric signal columns. |
time_col |
Name of the numeric time column. |
signal_cols |
Optional character vector of numeric columns to aggregate.
If |
group_cols |
Optional character vector of grouping columns. Downsampling is performed independently within each group. |
interval |
Positive width of each output time bin, expressed in the same
units as |
method |
Aggregation method applied to each signal within each bin:
|
na_rm |
Logical. If |
time_value |
Value assigned to the output time column: the bin
|
origin |
Optional finite numeric origin used to align the bin grid. If
|
The returned object records the number of contributing source rows for each bin and stores a structured downsampling log and settings as attributes.
A data frame with class "gazepoint_downsampled_data". The output
contains grouping columns, the downsampled time column, aggregated signals,
and n_source_rows. Attributes downsample_log and
downsample_settings provide provenance information.
dat <- data.frame( participant = rep(c("P01", "P02"), each = 6), time_ms = rep(0:5, 2), pupil = c(3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4) ) downsample_gazepoint_data( dat, time_col = "time_ms", signal_cols = "pupil", group_cols = "participant", interval = 3 )dat <- data.frame( participant = rep(c("P01", "P02"), each = 6), time_ms = rep(0:5, 2), pupil = c(3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4) ) downsample_gazepoint_data( dat, time_col = "time_ms", signal_cols = "pupil", group_cols = "participant", interval = 3 )
Enhance pulse/PPG peaks using repeated local baseline removal
enhance_gazepoint_ppg_peaks(x, sampling_rate_hz, iterations = 2L)enhance_gazepoint_ppg_peaks(x, sampling_rate_hz, iterations = 2L)
x |
Numeric pulse/PPG signal. |
sampling_rate_hz |
Sampling rate in Hz. |
iterations |
Number of enhancement passes. |
Enhanced numeric signal.
Segments an EDA/GSR signal around event timestamps and returns event-level SCR metrics, including SCR count, maximum amplitude, mean amplitude, AUC, and baseline-corrected epoch summaries.
epoch_gazepoint_scr( data, events, pre, post, time_col = NULL, signal_col = NULL, event_time_col = NULL, event_id_col = NULL, event_group_cols = NULL, baseline_window = NULL, response_window = NULL, min_amplitude = 0.01, min_distance_s = 1 )epoch_gazepoint_scr( data, events, pre, post, time_col = NULL, signal_col = NULL, event_time_col = NULL, event_id_col = NULL, event_group_cols = NULL, baseline_window = NULL, response_window = NULL, min_amplitude = 0.01, min_distance_s = 1 )
data |
Data frame containing time and EDA/GSR columns. |
events |
Numeric vector of event timestamps or a data frame with an event-time column. |
pre |
Seconds before each event to include. |
post |
Seconds after each event to include. |
time_col |
Time column in |
signal_col |
EDA/GSR signal column. If NULL, common names are detected. |
event_time_col |
Event-time column when |
event_id_col |
Optional event identifier column. |
event_group_cols |
Optional event metadata columns to carry into the output. |
baseline_window |
Baseline window relative to event time. Defaults to
|
response_window |
SCR response window relative to event time. Defaults
to |
min_amplitude |
Minimum peak-minus-trough amplitude counted as SCR. |
min_distance_s |
Minimum time between counted SCR peaks. |
Data frame with one row per event and event-level SCR metrics.
eda <- data.frame(time_s = seq(0, 10, by = .1), GSR = sin(seq(0, 10, by = .1)) / 20) epoch_gazepoint_scr(eda, events = 5, pre = 1, post = 3)eda <- data.frame(time_s = seq(0, 10, by = .1), GSR = sin(seq(0, 10, by = .1)) / 20) epoch_gazepoint_scr(eda, events = 5, pre = 1, post = 3)
Estimate breathing rate from RR/IBI frequency content
estimate_gazepoint_breathing_rate_from_ibi( rr_ms, rr_time_s = NULL, resample_hz = 4, breathing_band = c(0.1, 0.5) )estimate_gazepoint_breathing_rate_from_ibi( rr_ms, rr_time_s = NULL, resample_hz = 4, breathing_band = c(0.1, 0.5) )
rr_ms |
RR or IBI intervals in milliseconds. |
rr_time_s |
Optional interval time stamps in seconds. |
resample_hz |
Interpolation frequency. |
breathing_band |
Frequency band for breathing-rate search. |
A list with breathing_rate_hz, frequency, psd, and band.
Cluster-permutation timing should be interpreted descriptively, not as a precise offset estimate.
estimate_gazepoint_cluster_offset(...)estimate_gazepoint_cluster_offset(...)
... |
Ignored. |
This function always errors.
Cluster-permutation timing should be interpreted descriptively, not as a precise onset estimate.
estimate_gazepoint_cluster_onset(...)estimate_gazepoint_cluster_onset(...)
... |
Ignored. |
This function always errors.
Estimate BioSPPy-style EDA recovery times
estimate_gazepoint_eda_recovery_times( data, events = NULL, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, recovery_prop = 0.5, max_recovery_seconds = 10 )estimate_gazepoint_eda_recovery_times( data, events = NULL, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, recovery_prop = 0.5, max_recovery_seconds = 10 )
data |
Data frame or numeric EDA/GSR signal. |
events |
Optional event table from extract_gazepoint_eda_events_biosppy_style(). |
signal_col |
EDA/GSR column. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
sampling_rate_hz |
Sampling rate in Hz. |
recovery_prop |
Proportion of amplitude used for recovery threshold. |
max_recovery_seconds |
Maximum search window after peak. |
Event table with recovery-time columns.
Resolves active LSL streams and repeatedly calls each inlet's
time_correction() method. The returned correction is ready to pass to
sync_gazepoint_signals_via_lsl() as a value added to remote timestamps.
estimate_gazepoint_lsl_clock_offsets( stream_name = NULL, stream_type = NULL, source_id = NULL, timeout_s = 5, n_estimates = 5L, pause_s = 0.05, python = NULL, execute = TRUE )estimate_gazepoint_lsl_clock_offsets( stream_name = NULL, stream_type = NULL, source_id = NULL, timeout_s = 5, n_estimates = 5L, pause_s = 0.05, python = NULL, execute = TRUE )
stream_name |
Optional exact LSL stream name. |
stream_type |
Optional exact LSL stream type. |
source_id |
Optional exact LSL source ID. |
timeout_s |
Resolution and first-correction timeout. |
n_estimates |
Number of offset estimates per stream. |
pause_s |
Pause between estimates. |
python |
Optional Python executable or Windows |
execute |
If |
A "gazepoint_lsl_clock_offsets" object with raw estimates,
stream-level summaries, and named median offsets.
Estimates an exploratory respiration rate from low-frequency modulation in a PPG/BVP signal. This is a lightweight screening helper and should not be interpreted as a replacement for a respiratory sensor.
estimate_gazepoint_respiration_from_ppg( data, ppg_col = NULL, time_col = NULL, sampling_rate_hz = NULL, respiratory_band_hz = c(0.1, 0.5), detrend = TRUE )estimate_gazepoint_respiration_from_ppg( data, ppg_col = NULL, time_col = NULL, sampling_rate_hz = NULL, respiratory_band_hz = c(0.1, 0.5), detrend = TRUE )
data |
Data frame or numeric PPG vector. |
ppg_col |
PPG/BVP signal column for data-frame input. |
time_col |
Optional time column. |
sampling_rate_hz |
Sampling rate for vector input or when no time column is available. |
respiratory_band_hz |
Two-element frequency band used to search for the respiration peak. |
detrend |
If TRUE, remove a linear trend before spectral estimation. |
List with summary, spectrum, and settings.
Estimate sampling rate from datetime stamps
estimate_gazepoint_samplerate_datetime( datetime, format = NULL, tz = "UTC", robust = TRUE )estimate_gazepoint_samplerate_datetime( datetime, format = NULL, tz = "UTC", robust = TRUE )
datetime |
POSIXct, POSIXlt, Date, or character timestamps. |
format |
Optional datetime format for character input. |
tz |
Time zone used when parsing character input. |
robust |
If TRUE, use the median interval. |
Estimated sampling-rate information.
Estimate sampling rate from a millisecond timer
estimate_gazepoint_samplerate_mstimer(mstimer, robust = TRUE)estimate_gazepoint_samplerate_mstimer(mstimer, robust = TRUE)
mstimer |
Numeric millisecond timer. |
robust |
If TRUE, use the median interval. |
Estimated sampling-rate information.
Estimates the time shift that maximizes the association between two recorded biometric signals within each group. This is a conservative synchronization diagnostic for inspecting whether two recorded traces show similar temporal structure at different shifts. It should not be interpreted as causal timing or true physiological latency unless the design includes appropriate event markers and independently justified signal-processing assumptions.
estimate_gazepoint_signal_lag( data, signal_x_col, signal_y_col, time_col = NULL, group_cols = NULL, max_lag = 1000, lag_step = NULL, method = c("pearson", "spearman"), min_complete_pairs = 20, use_first_difference = FALSE )estimate_gazepoint_signal_lag( data, signal_x_col, signal_y_col, time_col = NULL, group_cols = NULL, max_lag = 1000, lag_step = NULL, method = c("pearson", "spearman"), min_complete_pairs = 20, use_first_difference = FALSE )
data |
A Gazepoint biometric data frame. |
signal_x_col |
Name of the first signal column. |
signal_y_col |
Name of the second signal column. |
time_col |
Optional time or counter column. If |
group_cols |
Optional grouping columns, such as participant, stimulus, trial, or source file. |
max_lag |
Maximum absolute lag to evaluate, in the same units as
|
lag_step |
Step size between candidate lags, in the same units as
|
method |
Correlation method passed to |
min_complete_pairs |
Minimum complete aligned observations required for a candidate lag. |
use_first_difference |
If |
A list with overview, lag_by_group, lag_profile, and settings.
Creates a plain Markdown audit-trail summary from a Gazepoint audit index. The output can be copied into supplementary materials, review responses, or project documentation. No rendering dependency is required.
export_gazepoint_audit_trail_markdown( audit_index, summary = NULL, title = "Gazepoint audit trail", include_details = TRUE, max_details = 50, file = NULL )export_gazepoint_audit_trail_markdown( audit_index, summary = NULL, title = "Gazepoint audit trail", include_details = TRUE, max_details = 50, file = NULL )
audit_index |
A |
summary |
Optional summary table. If |
title |
Markdown title. |
include_details |
Logical. If |
max_details |
Maximum number of detail rows to include. |
file |
Optional file path. If supplied, the Markdown text is written to disk. |
A single character string containing Markdown text.
Exports selected report tables, text outputs, optional plot objects, and a manifest to a local output directory. This helper is intended for reproducible reporting. It does not commit files and should not be used to export private real-data outputs into a package repository.
export_gazepoint_biometrics_report_bundle( bundle = NULL, output_dir, prefix = "gpbiometrics_report", tables = NULL, text = NULL, plots = NULL, include_readme = TRUE, include_session_info = TRUE, overwrite = FALSE )export_gazepoint_biometrics_report_bundle( bundle = NULL, output_dir, prefix = "gpbiometrics_report", tables = NULL, text = NULL, plots = NULL, include_readme = TRUE, include_session_info = TRUE, overwrite = FALSE )
bundle |
Optional list-like object containing data frames, text, or plots. |
output_dir |
Output directory. |
prefix |
File prefix. |
tables |
Optional named list of data frames to export as CSV files. |
text |
Optional named list or character vector of text outputs to export as TXT files. |
plots |
Optional named list of ggplot objects to export as PNG files. |
include_readme |
Logical. Should a README text file be written? |
include_session_info |
Logical. Should session information be written? |
overwrite |
Logical. Should existing files be overwritten? |
A list with overview, manifest, output_dir, and settings.
Writes the cluster summary, timewise statistics, null distribution, parameter table, and conservative reporting text to disk.
export_gazepoint_cluster_results( result, path = ".", prefix = "gazepoint_cluster", overwrite = FALSE )export_gazepoint_cluster_results( result, path = ".", prefix = "gazepoint_cluster", overwrite = FALSE )
result |
Object returned by |
path |
Output directory. |
prefix |
File-name prefix. |
overwrite |
Should existing files be overwritten? |
A data frame listing written files, invisibly.
Export Gazepoint pulse/PPG data for HeartPy-style workflows
export_gazepoint_heartpy_input( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, output_dir, prefix = "gazepoint_heartpy" )export_gazepoint_heartpy_input( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, output_dir, prefix = "gazepoint_heartpy" )
data |
Data frame containing Gazepoint biometric samples. |
signal_col |
Pulse/PPG signal column. If NULL, a likely column is inferred. |
time_col |
Time column in seconds. If NULL, a likely column is inferred or created from sampling_rate_hz. |
group_cols |
Optional grouping columns such as participant or trial identifiers. |
sampling_rate_hz |
Sampling rate in Hz. Required if time_col cannot be inferred. |
output_dir |
Optional directory for CSV export. If NULL, no files are written. |
prefix |
File prefix used when output_dir is supplied. |
A list returned by prepare_gazepoint_heartpy_input().
Prepares participant-level condition differences in a wide matrix format commonly used by MNE-style one-sample cluster-permutation workflows.
export_gazepoint_mne_cluster_input( data, outcome_col, time_col, condition_col, participant_col, condition_a = NULL, condition_b = NULL, path = NULL, prefix = "gazepoint_mne_cluster", overwrite = FALSE, aggregate = TRUE )export_gazepoint_mne_cluster_input( data, outcome_col, time_col, condition_col, participant_col, condition_a = NULL, condition_b = NULL, path = NULL, prefix = "gazepoint_mne_cluster", overwrite = FALSE, aggregate = TRUE )
data |
A data frame. |
outcome_col |
Numeric outcome column. |
time_col |
Time-bin column. |
condition_col |
Condition column. |
participant_col |
Participant identifier column. |
condition_a |
Reference condition. If |
condition_b |
Comparison condition. If |
path |
Optional output directory. If |
prefix |
File-name prefix used when |
overwrite |
Should existing files be overwritten? |
aggregate |
Should repeated participant-condition-time cells be averaged? |
A list containing long data, a wide difference matrix, and metadata, invisibly if files are written.
Prepares conservative long-format participant-level time-course data and
metadata for external analysis in packages such as permuco.
export_gazepoint_permuco_cluster_input( data, outcome_col, time_col, condition_col, participant_col, path = NULL, prefix = "gazepoint_permuco_cluster", overwrite = FALSE, aggregate = TRUE )export_gazepoint_permuco_cluster_input( data, outcome_col, time_col, condition_col, participant_col, path = NULL, prefix = "gazepoint_permuco_cluster", overwrite = FALSE, aggregate = TRUE )
data |
A data frame. |
outcome_col |
Numeric outcome column. |
time_col |
Time-bin column. |
condition_col |
Condition column. |
participant_col |
Participant identifier column. |
path |
Optional output directory. |
prefix |
File-name prefix. |
overwrite |
Should existing files be overwritten? |
aggregate |
Should repeated participant-condition-time cells be averaged? |
A list containing long data and metadata, or a file table if path
is supplied.
Prepares conservative long-format participant-level time-course data and
metadata for external analysis in packages such as permutes.
export_gazepoint_permutes_cluster_input( data, outcome_col, time_col, condition_col, participant_col, path = NULL, prefix = "gazepoint_permutes_cluster", overwrite = FALSE, aggregate = TRUE )export_gazepoint_permutes_cluster_input( data, outcome_col, time_col, condition_col, participant_col, path = NULL, prefix = "gazepoint_permutes_cluster", overwrite = FALSE, aggregate = TRUE )
data |
A data frame. |
outcome_col |
Numeric outcome column. |
time_col |
Time-bin column. |
condition_col |
Condition column. |
participant_col |
Participant identifier column. |
path |
Optional output directory. |
prefix |
File-name prefix. |
overwrite |
Should existing files be overwritten? |
aggregate |
Should repeated participant-condition-time cells be averaged? |
A list containing long data and metadata, or a file table if path
is supplied.
Converts a Gazepoint pipeline map to a lightweight DOT/Graphviz character string. The DOT text can be copied into external graph-rendering tools. This function does not require Graphviz, DiagrammeR, or any rendering dependency.
export_gazepoint_pipeline_dot( pipeline, file = NULL, graph_name = "gazepoint_pipeline", rankdir = "LR", include_descriptions = FALSE )export_gazepoint_pipeline_dot( pipeline, file = NULL, graph_name = "gazepoint_pipeline", rankdir = "LR", include_descriptions = FALSE )
pipeline |
A |
file |
Optional file path. If supplied, the DOT text is written to disk. |
graph_name |
DOT graph name. |
rankdir |
Graph direction. Common values are |
include_descriptions |
Logical. If |
A single character string containing DOT text.
Export PsPM-style Gazepoint model estimates
export_gazepoint_pspm_model_estimates( model, path, format = NULL, include_predictions = TRUE )export_gazepoint_pspm_model_estimates( model, path, format = NULL, include_predictions = TRUE )
model |
Model object from fit_gazepoint_convolution_glm(). |
path |
Output path. Use .csv, .rds, or .json. |
format |
Optional format. If NULL, inferred from path extension. |
include_predictions |
If TRUE, CSV export also writes predictions. |
Data frame of written files.
Export pyHRV-style results
export_gazepoint_pyhrv_results(results, path)export_gazepoint_pyhrv_results(results, path)
results |
Result object. |
path |
Output path. Use .json or .rds. |
Output path invisibly.
Prepares cleaned inter-beat interval data for external HRV workflows. The
helper writes simple beat tables with cumulative beat time and IBI/RR interval
columns. It does not use the Gazepoint HRV column.
export_gazepoint_rhrv_input( data, ibi_col = "IBI_clean_ms", group_cols = NULL, unit = c("auto", "ms", "seconds"), collapse_repeated_intervals = TRUE, repeated_tolerance_ms = 1e-08, min_ibi_ms = 300, max_ibi_ms = 2000, output_dir = NULL, prefix = "gazepoint_rhrv" )export_gazepoint_rhrv_input( data, ibi_col = "IBI_clean_ms", group_cols = NULL, unit = c("auto", "ms", "seconds"), collapse_repeated_intervals = TRUE, repeated_tolerance_ms = 1e-08, min_ibi_ms = 300, max_ibi_ms = 2000, output_dir = NULL, prefix = "gazepoint_rhrv" )
data |
A Gazepoint biometric data frame or |
ibi_col |
IBI/RR interval column. |
group_cols |
Optional grouping columns. |
unit |
Unit of the IBI column: |
collapse_repeated_intervals |
Logical. If |
repeated_tolerance_ms |
Numeric tolerance used when identifying repeated consecutive IBI values. |
min_ibi_ms |
Minimum plausible IBI in milliseconds retained for export. |
max_ibi_ms |
Maximum plausible IBI in milliseconds retained for export. |
output_dir |
Optional directory where per-group CSV files are written. |
prefix |
File prefix used when |
A list with overview, beat_table, group_summary, manifest,
and settings.
Exports one Gazepoint eye-tracking recording as a BIDS 1.11.1
physiological-recording pair consisting of a compressed, headerless
_physio.tsv.gz file and a matching JSON sidecar.
export_gazepoint_to_bids( data, bids_root, subject, task, dataset_name = NULL, recorded_eye = c("cyclopean", "left", "right"), recording = "eye1", datatype = c("beh", "eeg", "emg", "func", "ieeg", "meg", "motion", "nirs", "pet"), session = NULL, acquisition = NULL, run = NULL, timestamp_col = NULL, x_col = NULL, y_col = NULL, include_pupil = TRUE, pupil_col = NULL, additional_cols = NULL, timestamp_units = c("auto", "seconds", "milliseconds", "microseconds"), coordinate_units = c("normalized", "pixel", "degree", "radian", "mm", "cm", "m", "arbitrary"), pupil_units = "arbitrary", sample_coordinate_system = c("gaze-on-screen", "eye-in-head", "gaze-in-world", "custom"), sampling_rate_hz = NULL, sampling_tolerance = 0.05, start_time_s = 0, screen_distance_m = NULL, screen_origin = NULL, screen_resolution_px = NULL, screen_size_m = NULL, screen_refresh_rate_hz = NULL, stimulus_software_name = NULL, stimulus_software_version = NULL, operating_system = NULL, vision_correction = NULL, manufacturer = "Gazepoint", manufacturers_model_name = NULL, software_versions = NULL, device_serial_number = NULL, eye_tracking_method = "P-CR", calibration_type = NULL, calibration_count = NULL, average_calibration_error_deg = NULL, maximal_calibration_error_deg = NULL, eye_tracker_distance_m = NULL, raw_data_filters = NULL, timestamp_origin = "Eye-tracker clock", custom_coordinate_system_description = NULL, column_metadata = list(), bids_version = "1.11.1", dry_run = FALSE, overwrite = FALSE )export_gazepoint_to_bids( data, bids_root, subject, task, dataset_name = NULL, recorded_eye = c("cyclopean", "left", "right"), recording = "eye1", datatype = c("beh", "eeg", "emg", "func", "ieeg", "meg", "motion", "nirs", "pet"), session = NULL, acquisition = NULL, run = NULL, timestamp_col = NULL, x_col = NULL, y_col = NULL, include_pupil = TRUE, pupil_col = NULL, additional_cols = NULL, timestamp_units = c("auto", "seconds", "milliseconds", "microseconds"), coordinate_units = c("normalized", "pixel", "degree", "radian", "mm", "cm", "m", "arbitrary"), pupil_units = "arbitrary", sample_coordinate_system = c("gaze-on-screen", "eye-in-head", "gaze-in-world", "custom"), sampling_rate_hz = NULL, sampling_tolerance = 0.05, start_time_s = 0, screen_distance_m = NULL, screen_origin = NULL, screen_resolution_px = NULL, screen_size_m = NULL, screen_refresh_rate_hz = NULL, stimulus_software_name = NULL, stimulus_software_version = NULL, operating_system = NULL, vision_correction = NULL, manufacturer = "Gazepoint", manufacturers_model_name = NULL, software_versions = NULL, device_serial_number = NULL, eye_tracking_method = "P-CR", calibration_type = NULL, calibration_count = NULL, average_calibration_error_deg = NULL, maximal_calibration_error_deg = NULL, eye_tracker_distance_m = NULL, raw_data_filters = NULL, timestamp_origin = "Eye-tracker clock", custom_coordinate_system_description = NULL, column_metadata = list(), bids_version = "1.11.1", dry_run = FALSE, overwrite = FALSE )
data |
Data frame containing regularly sampled Gazepoint eye-tracking samples. |
bids_root |
Root directory of the BIDS dataset. |
subject |
BIDS subject label without the |
task |
BIDS task label without the |
dataset_name |
Dataset name used when creating
|
recorded_eye |
Recorded eye: |
recording |
Required BIDS recording label. The recommended labels are
|
datatype |
BIDS datatype directory. Supported values are |
session |
Optional BIDS session label without the |
acquisition |
Optional BIDS acquisition label without the |
run |
Optional non-negative BIDS run index. |
timestamp_col |
Timestamp column issued by the eye tracker. If |
x_col |
Horizontal gaze-coordinate column. If |
y_col |
Vertical gaze-coordinate column. If |
include_pupil |
Logical. Attempt to include a |
pupil_col |
Optional pupil-size column. If |
additional_cols |
Optional additional numeric or logical columns to append after the prescribed eye-tracking columns. |
timestamp_units |
Units of the source timestamp: |
coordinate_units |
Units of the gaze coordinates. |
pupil_units |
Units of pupil size when included. |
sample_coordinate_system |
Coordinate system: |
sampling_rate_hz |
Optional positive sampling frequency. If omitted, it is inferred from the timestamps. |
sampling_tolerance |
Maximum relative deviation from the expected sampling interval. |
start_time_s |
BIDS |
screen_distance_m |
Required for |
screen_origin |
Two strings describing vertical and horizontal screen
origin, for example |
screen_resolution_px |
Two positive integers giving screen width and height in pixels. |
screen_size_m |
Two positive numbers giving screen width and height in metres. |
screen_refresh_rate_hz |
Optional screen refresh rate. |
stimulus_software_name |
Optional stimulus-presentation software name. |
stimulus_software_version |
Optional stimulus-presentation software version. |
operating_system |
Optional operating-system description. |
vision_correction |
Optional vision-correction description. |
manufacturer |
Optional eye-tracker manufacturer. |
manufacturers_model_name |
Optional eye-tracker model. |
software_versions |
Optional acquisition-software version. |
device_serial_number |
Optional device serial number or pseudonym. |
eye_tracking_method |
Optional eye-tracking method. |
calibration_type |
Optional calibration type, for example |
calibration_count |
Optional non-negative calibration count. |
average_calibration_error_deg |
Optional average calibration error. |
maximal_calibration_error_deg |
Optional maximal calibration error. |
eye_tracker_distance_m |
Optional eye-to-tracker distance in metres. |
raw_data_filters |
Optional description of device-side filters. |
timestamp_origin |
Description of the timestamp origin. |
custom_coordinate_system_description |
Required when
|
column_metadata |
Optional named list of additional or replacement metadata entries for exported columns. |
bids_version |
BIDS specification version written to a newly created dataset description. |
dry_run |
Logical. Validate and preview paths without writing files. |
overwrite |
Logical. Permit replacement of the recording pair and merging of supplied stimulus metadata into an existing events JSON file. |
One call exports one eye or one cyclopean recording. Binocular recordings
should be exported through separate calls with different recording labels
and appropriate RecordedEye metadata.
The compressed TSV file is headerless. Its first three columns are always
timestamp, x_coordinate, and y_coordinate. Missing numeric values are
written as n/a.
When sample_coordinate_system = "gaze-on-screen", the corresponding events
JSON metadata must define screen distance, origin, resolution, and physical
size. This function creates or validates that metadata.
This helper does not execute the external BIDS Validator. Exported datasets should still be checked with the current official validator.
An object of class "gazepoint_bids_export" containing the prepared
table, sidecars, file manifest, audit information, and settings.
gaze <- data.frame( TIME = c(0, 1 / 60, 2 / 60), BPOGX = c(0.45, 0.46, 0.47), BPOGY = c(0.52, 0.51, 0.50) ) preview <- export_gazepoint_to_bids( gaze, bids_root = tempfile("bids-"), subject = "01", task = "viewing", dataset_name = "Gazepoint viewing study", recorded_eye = "cyclopean", coordinate_units = "normalized", screen_distance_m = 0.60, screen_origin = c("top", "left"), screen_resolution_px = c(1920, 1080), screen_size_m = c(0.53, 0.30), dry_run = TRUE ) preview$filesgaze <- data.frame( TIME = c(0, 1 / 60, 2 / 60), BPOGX = c(0.45, 0.46, 0.47), BPOGY = c(0.52, 0.51, 0.50) ) preview <- export_gazepoint_to_bids( gaze, bids_root = tempfile("bids-"), subject = "01", task = "viewing", dataset_name = "Gazepoint viewing study", recorded_eye = "cyclopean", coordinate_units = "normalized", screen_distance_m = 0.60, screen_origin = c("top", "left"), screen_resolution_px = c(1920, 1080), screen_size_m = c(0.53, 0.30), dry_run = TRUE ) preview$files
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.
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 )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 )
dat |
A data frame. |
pulse_col |
Numeric pulse/PPG column. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns. |
k |
Number of k-means clusters. |
peak_polarity |
|
min_distance_s |
Minimum time between selected beats. |
sampling_rate |
Optional sampling rate in Hz. |
seed |
Optional random seed. |
A list with overview, beat_table, interval_table,
timeseries, and settings.
Computes left-right electrodermal activity asymmetry descriptors from two simultaneously recorded EDA channels. The function returns row-level asymmetry time series and group-level summaries.
extract_gazepoint_bilateral_eda_asymmetry( dat, left_col, right_col, time_col = NULL, group_cols = NULL, output_prefix = "beda" )extract_gazepoint_bilateral_eda_asymmetry( dat, left_col, right_col, time_col = NULL, group_cols = NULL, output_prefix = "beda" )
dat |
A data frame. |
left_col |
Numeric left-side EDA column. |
right_col |
Numeric right-side EDA column. |
time_col |
Optional numeric time column for ordering and gradient calculation. |
group_cols |
Optional grouping columns. |
output_prefix |
Prefix used for row-level output columns. |
These descriptors quantify bilateral EDA differences only. They do not infer hemisphere activation, amygdala activity, psychopathology, emotion, stress, cognition, health status, or diagnosis.
A list with overview, asymmetry_timeseries, summary, and
settings.
Computes dependency-light EDA complexity descriptors, including sample entropy and detrended fluctuation analysis alpha.
extract_gazepoint_eda_complexity( dat, eda_col = "GSR_US", group_cols = NULL, min_samples = 32, sampen_m = 2, sampen_r_multiplier = 0.2 )extract_gazepoint_eda_complexity( dat, eda_col = "GSR_US", group_cols = NULL, min_samples = 32, sampen_m = 2, sampen_r_multiplier = 0.2 )
dat |
A data frame containing EDA data. |
eda_col |
EDA/conductance column. |
group_cols |
Optional grouping columns. |
min_samples |
Minimum finite samples per group. |
sampen_m |
Embedding dimension for sample entropy. |
sampen_r_multiplier |
Tolerance multiplier applied to within-group SD. |
A list with overview, features, and settings.
Extract BioSPPy-style EDA events from Gazepoint GSR/EDA data
extract_gazepoint_eda_events_biosppy_style( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, smoothing_seconds = 1, min_amplitude = NULL, min_distance_seconds = 1, onset_window_seconds = 4 )extract_gazepoint_eda_events_biosppy_style( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, smoothing_seconds = 1, min_amplitude = NULL, min_distance_seconds = 1, onset_window_seconds = 4 )
data |
Data frame or numeric EDA/GSR signal. |
signal_col |
EDA/GSR column. |
time_col |
Optional time column in seconds. |
group_cols |
Optional grouping columns. |
sampling_rate_hz |
Sampling rate in Hz. |
smoothing_seconds |
Smoothing window for tonic estimate. |
min_amplitude |
Minimum SCR amplitude. |
min_distance_seconds |
Minimum distance between SCR peaks. |
onset_window_seconds |
Window before peak used to find onset. |
Data frame of EDA events.
Computes power spectral density summaries for an EDA signal, including spectral power in the EDASymp-inspired 0.045–0.25 Hz band. This is a descriptive spectral feature and should not be interpreted as direct stress, emotion, valence, cognition, trust, preference, or diagnosis.
extract_gazepoint_eda_spectral_power( dat, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, sampling_rate = NULL, band = c(0.045, 0.25), min_samples = 32, detrend = TRUE )extract_gazepoint_eda_spectral_power( dat, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, sampling_rate = NULL, band = c(0.045, 0.25), min_samples = 32, detrend = TRUE )
dat |
A data frame containing EDA data. |
eda_col |
EDA/conductance column. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Optional sampling rate in Hz. Required if |
band |
Numeric vector of length two defining the frequency band in Hz. |
min_samples |
Minimum finite samples per group. |
detrend |
Logical. If |
A list with overview, spectral_summary, settings, and
interpretation text.
Computes a dependency-light approximation of TVSymp-style time-varying spectral EDA power using sliding-window spectral analysis. The default band is 0.08–0.24 Hz, following the TVSymp literature. This function does not claim exact VFCDM reproduction.
extract_gazepoint_eda_tvsymp( dat, eda_col = "GSR_US", time_col = "CNT", group_cols = NULL, sampling_rate = NULL, band = c(0.08, 0.24), window_seconds = 60, step_seconds = 5, min_valid_fraction = 0.7, normalise = TRUE )extract_gazepoint_eda_tvsymp( dat, eda_col = "GSR_US", time_col = "CNT", group_cols = NULL, sampling_rate = NULL, band = c(0.08, 0.24), window_seconds = 60, step_seconds = 5, min_valid_fraction = 0.7, normalise = TRUE )
dat |
A data frame containing EDA data. |
eda_col |
Numeric EDA/conductance column. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Optional sampling rate in Hz. If |
band |
Frequency band in Hz used for TVSymp-style power. |
window_seconds |
Sliding-window length in seconds. |
step_seconds |
Sliding-window step in seconds. |
min_valid_fraction |
Minimum valid fraction per window. |
normalise |
Logical. If |
A list with overview, tvsymp_timeseries, summary, and settings.
Extracts an ECG-derived respiration proxy from beat-level ECG morphology features using principal component analysis. This function requires ECG-derived morphology columns, such as QRS amplitudes, widths, or sampled beat-shape features. It is not intended for HR, IBI, or PPG-only data.
extract_gazepoint_edr_pca( dat, ecg_cols, time_col = NULL, group_cols = NULL, n_components = 1, scale = TRUE, output_prefix = "edr_pca" )extract_gazepoint_edr_pca( dat, ecg_cols, time_col = NULL, group_cols = NULL, n_components = 1, scale = TRUE, output_prefix = "edr_pca" )
dat |
A data frame. |
ecg_cols |
Numeric ECG morphology columns. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
n_components |
Number of PCA components to retain. |
scale |
Logical. If |
output_prefix |
Prefix for PCA output columns. |
A list with overview, edr_timeseries, component_summary, and
settings.
Computes dependency-light heart-rate asymmetry descriptors from IBI/RR intervals, including acceleration/deceleration proportions, signed run summaries, and Guzik-style squared-difference asymmetry.
extract_gazepoint_hrv_asymmetry( dat, ibi_col = "IBI", group_cols = NULL, zero_tolerance = 0 )extract_gazepoint_hrv_asymmetry( dat, ibi_col = "IBI", group_cols = NULL, zero_tolerance = 0 )
dat |
A data frame containing IBI/RR intervals. |
ibi_col |
Numeric IBI/RR interval column. |
group_cols |
Optional grouping columns. |
zero_tolerance |
Absolute change below which interval differences are treated as zero. |
Positive IBI/RR differences are treated as decelerations because the heart period lengthens. Negative IBI/RR differences are treated as accelerations.
A list with overview, features, run_table, and settings.
Computes simple time-domain HRV features from genuine IBI/RR intervals. This
helper does not use the Gazepoint HRV column as an HRV outcome.
extract_gazepoint_hrv_features( data, ibi_col = "IBI_clean_ms", group_cols = NULL, unit = c("auto", "ms", "seconds"), min_intervals = 3, min_duration_s = 30, diff_threshold_ms = 50, collapse_repeated_intervals = TRUE, repeated_tolerance_ms = 1e-08 )extract_gazepoint_hrv_features( data, ibi_col = "IBI_clean_ms", group_cols = NULL, unit = c("auto", "ms", "seconds"), min_intervals = 3, min_duration_s = 30, diff_threshold_ms = 50, collapse_repeated_intervals = TRUE, repeated_tolerance_ms = 1e-08 )
data |
A Gazepoint biometric data frame or |
ibi_col |
IBI/RR interval column. |
group_cols |
Optional grouping columns. |
unit |
Unit of the IBI column: |
min_intervals |
Minimum clean intervals required per group. |
min_duration_s |
Minimum IBI-sequence duration in seconds required before
computed HRV features are treated as fully reportable. Groups below this
duration still return features but receive |
diff_threshold_ms |
Threshold for NN50/pNN50. |
collapse_repeated_intervals |
Logical. If |
repeated_tolerance_ms |
Numeric tolerance used when identifying repeated consecutive IBI values. |
A list with overview, features, settings.
Computes dependency-light heart-rate fragmentation descriptors from IBI/RR intervals. Metrics include percentage of inflection points (PIP), inverse average segment length (IALS), percentage of short segments (PSS), percentage of alternation segments (PAS), and long/short segment summaries.
extract_gazepoint_hrv_fragmentation( dat, ibi_col = "IBI", group_cols = NULL, zero_tolerance = 0, short_segment_length = 3 )extract_gazepoint_hrv_fragmentation( dat, ibi_col = "IBI", group_cols = NULL, zero_tolerance = 0, short_segment_length = 3 )
dat |
A data frame containing IBI/RR intervals. |
ibi_col |
Numeric IBI/RR interval column. |
group_cols |
Optional grouping columns. |
zero_tolerance |
Absolute change below which interval differences are treated as zero. |
short_segment_length |
Maximum segment length counted as short. |
These are fragmentation descriptors of interbeat interval dynamics. They should not be interpreted as clinical diagnoses or direct autonomic-state labels by themselves.
A list with overview, features, and settings.
Computes fuzzy entropy and Lorenz/Poincare-derived cardiac sympathetic index style descriptors from IBI/RR intervals.
extract_gazepoint_hrv_fuzzy_csi( dat, ibi_col = "IBI", group_cols = NULL, m = 2, r_multiplier = 0.2, fuzzy_power = 2, min_intervals = 10 )extract_gazepoint_hrv_fuzzy_csi( dat, ibi_col = "IBI", group_cols = NULL, m = 2, r_multiplier = 0.2, fuzzy_power = 2, min_intervals = 10 )
dat |
A data frame. |
ibi_col |
Numeric IBI/RR interval column. |
group_cols |
Optional grouping columns. |
m |
Embedding dimension. |
r_multiplier |
Tolerance multiplier applied to within-group SD. |
fuzzy_power |
Fuzzy exponential power. |
min_intervals |
Minimum intervals per group. |
These outputs are nonlinear/geometric HRV descriptors. They do not infer seizure status, diagnosis, health status, emotion, stress, or cognition.
A list with overview, features, and settings.
Computes dependency-light geometric HRV descriptors, including the HRV triangular index and an approximate TINN-style triangular interpolation width.
extract_gazepoint_hrv_geometric( dat, ibi_col = "IBI", group_cols = NULL, bin_width = NULL )extract_gazepoint_hrv_geometric( dat, ibi_col = "IBI", group_cols = NULL, bin_width = NULL )
dat |
A data frame. |
ibi_col |
Numeric IBI/RR interval column. |
group_cols |
Optional grouping columns. |
bin_width |
Histogram bin width in the same units as |
A list with overview, features, and settings.
Computes dependency-light nonlinear HRV descriptors from IBI/RR intervals, including Poincare SD1/SD2, sample entropy, approximate entropy, multiscale entropy, and detrended fluctuation analysis.
extract_gazepoint_hrv_nonlinear( dat, ibi_col = "IBI", group_cols = NULL, min_intervals = 10, sampen_m = 2, sampen_r_multiplier = 0.2, mse_scales = 1:5 )extract_gazepoint_hrv_nonlinear( dat, ibi_col = "IBI", group_cols = NULL, min_intervals = 10, sampen_m = 2, sampen_r_multiplier = 0.2, mse_scales = 1:5 )
dat |
A data frame containing IBI/RR intervals. |
ibi_col |
IBI/RR interval column. |
group_cols |
Optional grouping columns. |
min_intervals |
Minimum finite intervals per group. |
sampen_m |
Embedding dimension for sample entropy. |
sampen_r_multiplier |
Tolerance multiplier applied to the within-group SD. |
mse_scales |
Integer scales used for multiscale entropy. |
These are variability and complexity descriptors. They should not be interpreted as direct emotion, cognitive-load, health-status, or diagnostic labels by themselves.
A list with overview, features, and settings.
Computes refined composite multiscale entropy (RCMSE) from IBI/RR intervals. RCMSE pools template-match counts across all coarse-grained offsets at each scale, making it more stable than ordinary MSE for shorter physiological time series.
extract_gazepoint_hrv_rcmse( dat, ibi_col = "IBI", group_cols = NULL, scales = 1:10, m = 2, r_multiplier = 0.2, min_intervals = 20 )extract_gazepoint_hrv_rcmse( dat, ibi_col = "IBI", group_cols = NULL, scales = 1:10, m = 2, r_multiplier = 0.2, min_intervals = 20 )
dat |
A data frame containing IBI/RR intervals. |
ibi_col |
Numeric IBI/RR interval column. |
group_cols |
Optional grouping columns. |
scales |
Positive integer scales. |
m |
Embedding dimension. |
r_multiplier |
Tolerance multiplier applied to SD. |
min_intervals |
Minimum intervals per group. |
A list with overview, rcmse_by_scale, summary, and settings.
Computes dependency-light recurrence quantification analysis (RQA) features from IBI/RR intervals. This is intended as a compact nonlinear HRV summary and not as a clinical diagnostic tool.
extract_gazepoint_hrv_rqa( dat, ibi_col = "IBI", group_cols = NULL, embedding_dimension = 2, delay = 1, radius = NULL, radius_multiplier = 0.2, min_line_length = 2 )extract_gazepoint_hrv_rqa( dat, ibi_col = "IBI", group_cols = NULL, embedding_dimension = 2, delay = 1, radius = NULL, radius_multiplier = 0.2, min_line_length = 2 )
dat |
A data frame. |
ibi_col |
Numeric IBI/RR interval column. |
group_cols |
Optional grouping columns. |
embedding_dimension |
Embedding dimension for phase-space reconstruction. |
delay |
Delay used in embedding. |
radius |
Radius for recurrence threshold. If |
radius_multiplier |
Multiplier used when |
min_line_length |
Minimum diagonal/vertical line length. |
A list with overview, features, and settings.
Extract PsPM-style marker information from Gazepoint biometrics data
extract_gazepoint_markerinfo_pspm_style( data, marker_cols = NULL, time_col = NULL, sampling_rate_hz = NULL, group_cols = NULL, edge = c("rising", "change", "nonzero"), nonzero_only = TRUE )extract_gazepoint_markerinfo_pspm_style( data, marker_cols = NULL, time_col = NULL, sampling_rate_hz = NULL, group_cols = NULL, edge = c("rising", "change", "nonzero"), nonzero_only = TRUE )
data |
Gazepoint data frame. |
marker_cols |
Marker/TTL columns. If NULL, likely marker columns are inferred. |
time_col |
Time column in seconds. If NULL, inferred or created from sampling_rate_hz. |
sampling_rate_hz |
Sampling rate used when no time column is available. |
group_cols |
Optional grouping columns such as participant or trial. |
edge |
Event rule: rising, change, or nonzero. |
nonzero_only |
Whether zero-valued markers should be ignored. |
Data frame with marker events.
Extracts dependency-light PPG-derived respiration proxy features from a Gazepoint pulse/PPG waveform. The function estimates respiration-modulated pulse features such as respiratory-induced intensity variability (RIIV), pulse amplitude variability (PAV), pulse width variability (PWV), and pulse-rate variability (PRV).
extract_gazepoint_pdr_signals( dat, ppg_col = "HRP", time_col = "CNT", group_cols = NULL, sampling_rate = NULL, min_peak_distance_s = 0.3, smooth_window = 5, respiration_band = c(0.1, 0.6), pdr_resample_rate = 4 )extract_gazepoint_pdr_signals( dat, ppg_col = "HRP", time_col = "CNT", group_cols = NULL, sampling_rate = NULL, min_peak_distance_s = 0.3, smooth_window = 5, respiration_band = c(0.1, 0.6), pdr_resample_rate = 4 )
dat |
A data frame containing a PPG/pulse waveform. |
ppg_col |
Numeric PPG/pulse waveform column, often |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Optional sampling rate in Hz. If |
min_peak_distance_s |
Minimum plausible distance between pulse peaks. |
smooth_window |
Number of samples used for simple moving-average smoothing before peak detection. |
respiration_band |
Expected respiration-frequency band in Hz. |
pdr_resample_rate |
Resampling rate used for spectral estimation of PDR proxy signals. |
These are proxy respiratory features. They should not be treated as a replacement for a respiration belt or clinical respiratory measurement.
A list with overview, pulse_features, pdr_timeseries,
pdr_summary, and settings.
Extracts peak-centered pulse morphology metrics from a PPG/BVP signal, including rise time, decay time, half-amplitude width, pulse amplitude, and a simple post-peak notch proxy.
extract_gazepoint_ppg_morphology( data, time_col = NULL, ppg_col = NULL, peaks = NULL, min_peak_distance_s = 0.3 )extract_gazepoint_ppg_morphology( data, time_col = NULL, ppg_col = NULL, peaks = NULL, min_peak_distance_s = 0.3 )
data |
PPG data frame. |
time_col |
Time column. |
ppg_col |
PPG/BVP signal column. |
peaks |
Optional peak indices or peak times. |
min_peak_distance_s |
Minimum distance between automatically detected peaks. |
Data frame with one row per pulse peak.
Extract BioSPPy-style PPG pulse templates
extract_gazepoint_ppg_templates( data, signal_col = NULL, time_col = NULL, peaks = NULL, group_cols = NULL, sampling_rate_hz = NULL, before_seconds = 0.3, after_seconds = 0.6 )extract_gazepoint_ppg_templates( data, signal_col = NULL, time_col = NULL, peaks = NULL, group_cols = NULL, sampling_rate_hz = NULL, before_seconds = 0.3, after_seconds = 0.6 )
data |
Data frame or numeric PPG/BVP signal. |
signal_col |
PPG/BVP column. |
time_col |
Optional time column. |
peaks |
Optional peak table or peak indices. |
group_cols |
Optional grouping columns. |
sampling_rate_hz |
Sampling rate in Hz. |
before_seconds |
Seconds before peak. |
after_seconds |
Seconds after peak. |
List with templates, average template, and template time.
Extract NN intervals from peak timestamps
extract_gazepoint_pyhrv_nn_intervals( peaks, peak_time_col = "peak_time_s", time_unit = c("seconds", "milliseconds") )extract_gazepoint_pyhrv_nn_intervals( peaks, peak_time_col = "peak_time_s", time_unit = c("seconds", "milliseconds") )
peaks |
Data frame with peak timestamps, or numeric peak timestamps. |
peak_time_col |
Peak timestamp column when peaks is a data frame. |
time_unit |
Unit of peak timestamps: seconds or milliseconds. |
Numeric NN intervals in milliseconds.
Extracts respiration-like components from PPG or ECG-derived respiratory
proxy signals. If external_fun is supplied, it is used as the CEEMDAN
backend. Otherwise, the function uses a dependency-light multiscale
decomposition fallback and labels the result accordingly.
extract_gazepoint_respiration_ceemdan( dat, signal_col, time_col = "CNT", group_cols = NULL, sampling_rate = NULL, respiration_band = c(0.1, 0.6), scales = c(5, 15, 30, 60, 120), external_fun = NULL )extract_gazepoint_respiration_ceemdan( dat, signal_col, time_col = "CNT", group_cols = NULL, sampling_rate = NULL, respiration_band = c(0.1, 0.6), scales = c(5, 15, 30, 60, 120), external_fun = NULL )
dat |
A data frame. |
signal_col |
Numeric PPG/ECG-derived signal column. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Optional sampling rate in Hz. |
respiration_band |
Frequency band in Hz used to select respiration-like components. |
scales |
Moving-average scales used by the fallback decomposition. |
external_fun |
Optional function with arguments |
This function does not claim to reproduce full CEEMDAN unless a validated external CEEMDAN function is supplied.
A list with overview, component_table, respiration_timeseries,
summary, and settings.
Extracts 50 percent half-recovery time (rec.t2) and 63 percent recovery
time (rec.tc) for skin conductance responses from an EDA waveform and
event onsets.
extract_gazepoint_scr_recovery_times( dat, eda_col = "GSR_US", time_col = "CNT", event_onset_col = NULL, group_cols = NULL, pre_onset_baseline_s = 2, peak_window_s = 5, recovery_window_s = 20 )extract_gazepoint_scr_recovery_times( dat, eda_col = "GSR_US", time_col = "CNT", event_onset_col = NULL, group_cols = NULL, pre_onset_baseline_s = 2, peak_window_s = 5, recovery_window_s = 20 )
dat |
A data frame. |
eda_col |
Numeric EDA/conductance column. |
time_col |
Numeric time column. |
event_onset_col |
Optional event onset column. Finite values are treated as event onsets. |
group_cols |
Optional grouping columns. |
pre_onset_baseline_s |
Baseline window before event onset. |
peak_window_s |
Window after onset used to find the response peak. |
recovery_window_s |
Window after peak used to find recovery. |
A list with overview, recovery_table, and settings.
Extract event-centred Gazepoint segments PsPM-style
extract_gazepoint_segments_pspm_style( data, events, signal_col, time_col = NULL, event_time_col = "onset_time_s", event_id_col = NULL, condition_col = NULL, pre_s = 1, post_s = 5, baseline_window = c(-1, 0), baseline_correct = TRUE )extract_gazepoint_segments_pspm_style( data, events, signal_col, time_col = NULL, event_time_col = "onset_time_s", event_id_col = NULL, condition_col = NULL, pre_s = 1, post_s = 5, baseline_window = c(-1, 0), baseline_correct = TRUE )
data |
Gazepoint signal data. |
events |
Event table. |
signal_col |
Signal column. |
time_col |
Signal time column. |
event_time_col |
Event onset-time column. |
event_id_col |
Optional event-id column. |
condition_col |
Optional condition column. |
pre_s |
Seconds before event. |
post_s |
Seconds after event. |
baseline_window |
Baseline window relative to event. |
baseline_correct |
If TRUE, subtract event baseline. |
Long-format segment table.
Extracts TTL marker events from Gazepoint Biometrics exports. The function can return either rows where TTL marker values change or all nonzero TTL rows. By default, rows are retained only when the TTL validity column is present and greater than zero. This avoids treating invalid placeholder TTL values as experimental events.
extract_gazepoint_ttl_events( data, ttl_columns = NULL, group_columns = NULL, validity_column = "TTLV", require_validity = TRUE, mode = c("changes", "nonzero"), include_initial = TRUE )extract_gazepoint_ttl_events( data, ttl_columns = NULL, group_columns = NULL, validity_column = "TTLV", require_validity = TRUE, mode = c("changes", "nonzero"), include_initial = TRUE )
data |
A data frame or a path to a Gazepoint CSV export. |
ttl_columns |
TTL marker columns. If |
group_columns |
Optional grouping columns within which TTL changes are
detected, such as |
validity_column |
Optional TTL validity column. Defaults to |
require_validity |
Logical. Should rows be retained only when
|
mode |
Event extraction mode. |
include_initial |
Should the first valid, non-missing TTL value within
each group be treated as an event when |
A data frame of TTL events.
Flags and optionally removes gaze samples outside screen bounds or with implausibly high point-to-point velocity.
filter_gazepoint_gaze( data, x_col = NULL, y_col = NULL, time_col = NULL, group_cols = NULL, screen_bounds = c(0, 1, 0, 1), max_velocity = Inf, drop_invalid = FALSE, suffix = "_filtered" )filter_gazepoint_gaze( data, x_col = NULL, y_col = NULL, time_col = NULL, group_cols = NULL, screen_bounds = c(0, 1, 0, 1), max_velocity = Inf, drop_invalid = FALSE, suffix = "_filtered" )
data |
Gaze data frame. |
x_col |
Gaze x column. If NULL, common Gazepoint columns are detected. |
y_col |
Gaze y column. If NULL, common Gazepoint columns are detected. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
screen_bounds |
Numeric vector |
max_velocity |
Maximum allowed gaze velocity in coordinate units per
second. Use |
drop_invalid |
If TRUE, return only valid rows. |
suffix |
Suffix for filtered coordinate columns. |
Data frame with validity flags, velocity, filter reason, and filtered x/y columns.
gaze <- data.frame(time_s = 1:3, BPOGX = c(.1, .2, 2), BPOGY = c(.2, .3, .4)) filter_gazepoint_gaze(gaze, screen_bounds = c(0, 1, 0, 1))gaze <- data.frame(time_s = 1:3, BPOGX = c(.1, .2, 2), BPOGY = c(.2, .3, .4)) filter_gazepoint_gaze(gaze, screen_bounds = c(0, 1, 0, 1))
Flags and optionally cleans implausible inter-beat interval values. The helper
is conservative and does not remove rows; instead, it returns row-level flags
and a cleaned IBI column with implausible values set to NA.
filter_gazepoint_ibi_implausible( data, ibi_col = "IBI", time_col = NULL, group_cols = NULL, validity_col = NULL, unit = c("auto", "ms", "seconds"), min_ibi_ms = 300, max_ibi_ms = 2000, max_change_ms = 400, max_change_prop = 0.3, output_col = "IBI_clean_ms" )filter_gazepoint_ibi_implausible( data, ibi_col = "IBI", time_col = NULL, group_cols = NULL, validity_col = NULL, unit = c("auto", "ms", "seconds"), min_ibi_ms = 300, max_ibi_ms = 2000, max_change_ms = 400, max_change_prop = 0.3, output_col = "IBI_clean_ms" )
data |
A Gazepoint biometric data frame. |
ibi_col |
IBI/RR interval column. |
time_col |
Optional time/counter column. |
group_cols |
Optional grouping columns. |
validity_col |
Optional validity column. |
unit |
Unit of the IBI column: |
min_ibi_ms |
Minimum plausible IBI in milliseconds. |
max_ibi_ms |
Maximum plausible IBI in milliseconds. |
max_change_ms |
Maximum plausible absolute adjacent IBI change within group, in milliseconds. |
max_change_prop |
Maximum plausible proportional adjacent IBI change within group. |
output_col |
Name of the cleaned IBI output column. |
A list with overview, data, row_flags, group_summary, and
settings.
Apply a second-order Butterworth-style low-pass filter to pulse/PPG data
filter_gazepoint_ppg_butterworth( x, cutoff_hz = 5, sampling_rate_hz, passes = 1L )filter_gazepoint_ppg_butterworth( x, cutoff_hz = 5, sampling_rate_hz, passes = 1L )
x |
Numeric signal. |
cutoff_hz |
Low-pass cutoff frequency in Hz. |
sampling_rate_hz |
Sampling rate in Hz. |
passes |
Number of repeated two-pole sections. |
Filtered numeric signal.
Apply generic filtering to Gazepoint pulse/PPG data
filter_gazepoint_ppg_signal( x, sampling_rate_hz, type = c("lowpass", "highpass", "bandpass", "notch"), low_hz = NULL, high_hz = NULL, passes = 1L )filter_gazepoint_ppg_signal( x, sampling_rate_hz, type = c("lowpass", "highpass", "bandpass", "notch"), low_hz = NULL, high_hz = NULL, passes = 1L )
x |
Numeric signal. |
sampling_rate_hz |
Sampling rate in Hz. |
type |
Filter type: lowpass, highpass, bandpass, or notch. |
low_hz |
Low cutoff for highpass, bandpass, or notch. |
high_hz |
High cutoff for lowpass, bandpass, or notch. |
passes |
Repeated filter passes. |
Filtered numeric signal.
Applies conservative base-R preprocessing to selected numeric signal columns. Supported methods are moving average, rolling median, and linear detrending. The function returns new columns by default and records a processing log.
filter_gazepoint_signal( data, signal_cols, method = c("moving_average", "rolling_median", "detrend"), group_cols = NULL, time_col = NULL, window = 5, suffix = NULL, overwrite = FALSE, na_rm = FALSE )filter_gazepoint_signal( data, signal_cols, method = c("moving_average", "rolling_median", "detrend"), group_cols = NULL, time_col = NULL, window = 5, suffix = NULL, overwrite = FALSE, na_rm = FALSE )
data |
A data frame. |
signal_cols |
Character vector of numeric signal columns. |
method |
One of |
group_cols |
Optional grouping columns. |
time_col |
Optional numeric time column used for ordering within groups. |
window |
Window length for moving-average and rolling-median methods. |
suffix |
Optional suffix for created columns. If |
overwrite |
Logical. If |
na_rm |
Logical. If |
A data frame with class gazepoint_filtered_signal.
Fit PsPM-style event-related convolution GLM
fit_gazepoint_convolution_glm( data, design, signal_col, time_col = NULL, design_time_col = "time_s", regressor_cols = NULL )fit_gazepoint_convolution_glm( data, design, signal_col, time_col = NULL, design_time_col = "time_s", regressor_cols = NULL )
data |
Gazepoint signal data. |
design |
Design matrix from create_gazepoint_pspm_glm_design(). |
signal_col |
Signal column. |
time_col |
Time column in data. |
design_time_col |
Time column in design. |
regressor_cols |
Optional regressor columns. If NULL, inferred. |
List with coefficients, fitted values, residuals, and model summary.
Applies a user-supplied model or prediction function to segment-level artifact features. No pretrained model is bundled, so this function avoids pretending to reproduce any proprietary or externally trained classifier.
flag_gazepoint_artifacts_svm( x, model = NULL, feature_cols = NULL, probability_threshold = 0.5, ... )flag_gazepoint_artifacts_svm( x, model = NULL, feature_cols = NULL, probability_threshold = 0.5, ... )
x |
Either raw EDA data or output from
|
model |
Optional model object or function. If |
feature_cols |
Optional feature columns used by the model. |
probability_threshold |
Threshold for artifact probability. |
... |
Passed to |
A data frame with artifact probabilities/classes where available.
Flags missing-value runs and sustained flatline runs in Gazepoint biometric signal columns. Missing dropouts are defined as consecutive missing or non-finite numeric samples. Flatline dropouts are defined as consecutive finite numeric samples that remain unchanged within a tolerance.
flag_gazepoint_biometric_dropouts( data, signal_cols = NULL, group_cols = NULL, time_col = NULL, min_missing_run = 5L, min_flatline_run = 10L, constant_tolerance = 0, prefix = "biometric_dropout" )flag_gazepoint_biometric_dropouts( data, signal_cols = NULL, group_cols = NULL, time_col = NULL, min_missing_run = 5L, min_flatline_run = 10L, constant_tolerance = 0, prefix = "biometric_dropout" )
data |
A data frame. |
signal_cols |
Optional character vector of biometric signal columns. If
|
group_cols |
Optional grouping columns. Runs are computed separately within each group. |
time_col |
Optional time column used to order rows within each group
before run detection. If |
min_missing_run |
Minimum consecutive missing/non-finite samples required to flag a missing dropout. |
min_flatline_run |
Minimum consecutive unchanged finite samples required to flag a flatline dropout. |
constant_tolerance |
Numeric tolerance used when detecting unchanged values for flatline runs. |
prefix |
Prefix for generated dropout columns. |
The function adds row-level flags and stores a dropout summary in the returned data frame attributes. It does not remove rows.
The input data frame with added logical dropout columns. The attributes
dropout_summary and dropout_settings contain structured summaries.
df <- data.frame( CNT = 1:8, GSR = c(1, NA, NA, NA, 2, 2, 2, 3), HR = c(70, 71, 72, 73, 74, 75, 76, 77) ) flag_gazepoint_biometric_dropouts(df, min_missing_run = 3, min_flatline_run = 3)df <- data.frame( CNT = 1:8, GSR = c(1, NA, NA, NA, 2, 2, 2, 3), HR = c(70, 71, 72, 73, 74, 75, 76, 77) ) flag_gazepoint_biometric_dropouts(df, min_missing_run = 3, min_flatline_run = 3)
Splits RR/NN intervals into windows and flags segments with too few beats, implausible intervals, excessive beat-to-beat changes, short duration, or high artifact burden. The helper is intended as transparent QC before HRV summaries or mixed-model analysis.
flag_gazepoint_hrv_segments( data, rr_col = NULL, time_col = NULL, group_cols = NULL, window_s = 60, min_beats = 20, min_duration_s = 20, min_rr_ms = 300, max_rr_ms = 2000, max_artifact_prop = 0.2, max_successive_change_prop = 0.2 )flag_gazepoint_hrv_segments( data, rr_col = NULL, time_col = NULL, group_cols = NULL, window_s = 60, min_beats = 20, min_duration_s = 20, min_rr_ms = 300, max_rr_ms = 2000, max_artifact_prop = 0.2, max_successive_change_prop = 0.2 )
data |
Data frame or numeric RR/NN interval vector. |
rr_col |
RR/NN interval column for data-frame input. |
time_col |
Optional timestamp column. If omitted, cumulative RR time is used. |
group_cols |
Optional grouping columns such as participant or condition. |
window_s |
Optional window length in seconds. If NULL, one segment is returned per group. |
min_beats |
Minimum finite beats required for |
min_duration_s |
Minimum segment duration in seconds. |
min_rr_ms |
Minimum plausible RR interval in milliseconds. |
max_rr_ms |
Maximum plausible RR interval in milliseconds. |
max_artifact_prop |
Maximum allowed artifact proportion. |
max_successive_change_prop |
Maximum allowed proportional beat-to-beat change before an interval is flagged. |
Data frame with one row per segment.
Flags dependency-light, subject-specific EDA artifact categories using robust median absolute deviation (MAD) logic. The categories are heuristic QC labels: step artifacts, needle artifacts, flatline artifacts, and wall artifacts.
flag_gazepoint_mad_artifacts( dat, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, mad_multiplier = 8, flatline_tolerance = 1e-06, flatline_min_run = 5, wall_abs_change = NULL, output_prefix = "mad" )flag_gazepoint_mad_artifacts( dat, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, mad_multiplier = 8, flatline_tolerance = 1e-06, flatline_min_run = 5, wall_abs_change = NULL, output_prefix = "mad" )
dat |
A data frame. |
eda_col |
Numeric EDA/conductance column. |
time_col |
Optional time column for ordering within group. |
group_cols |
Optional grouping columns. |
mad_multiplier |
MAD multiplier used for robust thresholding. |
flatline_tolerance |
Maximum absolute sample-to-sample change treated as flatline. |
flatline_min_run |
Minimum consecutive flatline samples. |
wall_abs_change |
Optional absolute change threshold for wall artifacts. |
output_prefix |
Prefix for output columns. |
A data frame with artifact flags and artifact-summary attributes.
Computes windowed PPG quality metrics and flags segments with excessive missingness, flatness, or robust outliers.
flag_gazepoint_ppg_quality( data, time_col = NULL, ppg_col = NULL, window_s = 10, step_s = NULL, missing_prop_threshold = 0.2, flat_sd_threshold = 1e-06, outlier_prop_threshold = 0.1 )flag_gazepoint_ppg_quality( data, time_col = NULL, ppg_col = NULL, window_s = 10, step_s = NULL, missing_prop_threshold = 0.2, flat_sd_threshold = 1e-06, outlier_prop_threshold = 0.1 )
data |
PPG data frame. |
time_col |
Time column. |
ppg_col |
PPG/BVP signal column. |
window_s |
Window duration in seconds. |
step_s |
Step size in seconds. Defaults to |
missing_prop_threshold |
Maximum allowed missing proportion. |
flat_sd_threshold |
Minimum allowed standard deviation. |
outlier_prop_threshold |
Maximum allowed robust outlier proportion. |
Data frame with one row per segment.
Flags implausible RR intervals using absolute physiological limits and either robust MAD-based or z-score-based deviation rules.
flag_gazepoint_rr_outliers( rr_intervals, method = c("mad", "z", "range"), z_threshold = 5, mad_threshold = 5, min_rr = 300, max_rr = 2000, return = c("flags", "filtered", "data") )flag_gazepoint_rr_outliers( rr_intervals, method = c("mad", "z", "range"), z_threshold = 5, mad_threshold = 5, min_rr = 300, max_rr = 2000, return = c("flags", "filtered", "data") )
rr_intervals |
Numeric RR/IBI vector, usually in milliseconds. |
method |
|
z_threshold |
Z-score threshold when |
mad_threshold |
Robust MAD threshold when |
min_rr |
Minimum plausible RR interval in ms. |
max_rr |
Maximum plausible RR interval in ms. |
return |
|
Logical vector, filtered RR vector with outliers set to NA, or a data frame with reason columns.
flag_gazepoint_rr_outliers(c(800, 810, 3000, 790))flag_gazepoint_rr_outliers(c(800, 810, 3000, 790))
Applies simple transparent EDA artifact flags: non-finite values, physiological range violations, rapid percent change per second, and transitional padding around flagged samples.
flag_kleckner_eda_artifacts( dat, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, min_us = 0.01, max_us = 100, max_abs_percent_change_per_second = 20, transition_padding = 1, output_prefix = "kleckner" )flag_kleckner_eda_artifacts( dat, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, min_us = 0.01, max_us = 100, max_abs_percent_change_per_second = 20, transition_padding = 1, output_prefix = "kleckner" )
dat |
A data frame containing EDA data. |
eda_col |
Conductance column in microsiemens. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
min_us |
Minimum plausible conductance. |
max_us |
Maximum plausible conductance. |
max_abs_percent_change_per_second |
Maximum absolute percent change per second before flagging. |
transition_padding |
Number of neighbouring rows to flag around bad samples within each group. |
output_prefix |
Prefix for output columns. |
This helper is Kleckner-style rather than a claim of exact reproduction of every rule in a specific external implementation.
A data frame with artifact flag columns and summary attributes.
Flip a Gazepoint pulse/PPG signal
flip_gazepoint_ppg_signal(x, method = c("negative", "max_minus"))flip_gazepoint_ppg_signal(x, method = c("negative", "max_minus"))
x |
Numeric signal. |
method |
Flip method: negative or max_minus. |
Flipped numeric signal.
Adds user-facing labels and interpretation metadata to the package feature
inventory. This helper is intentionally non-breaking: it does not replace the
core inventory object returned by create_gazepoint_biometrics_feature_inventory().
format_gazepoint_biometrics_feature_inventory( inventory = NULL, include_internal = FALSE, sort = TRUE )format_gazepoint_biometrics_feature_inventory( inventory = NULL, include_internal = FALSE, sort = TRUE )
inventory |
Optional inventory object returned by
|
include_internal |
Logical. Passed to
|
sort |
Logical. If |
A data frame with polished user-facing inventory columns.
Fuses two respiration proxy streams, such as PPG-derived respiration and ECG-derived respiration, using a transparent one-dimensional Kalman filter. This is a linear Kalman fusion helper. It is not an extended Kalman filter unless the user supplies nonlinear state/measurement logic externally.
fuse_gazepoint_respiration_kalman( dat, primary_col, secondary_col, time_col = NULL, group_cols = NULL, process_var = 0.01, primary_var = 0.05, secondary_var = 0.05, output_col = "respiration_kalman_fused" )fuse_gazepoint_respiration_kalman( dat, primary_col, secondary_col, time_col = NULL, group_cols = NULL, process_var = 0.01, primary_var = 0.05, secondary_var = 0.05, output_col = "respiration_kalman_fused" )
dat |
A data frame. |
primary_col |
First respiration proxy column. |
secondary_col |
Second respiration proxy column. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
process_var |
Process variance. |
primary_var |
Measurement variance for |
secondary_var |
Measurement variance for |
output_col |
Output fused respiration column. |
A data frame with fused respiration output and Kalman attributes.
Creates the machine-readable interoperability manifest used by
audit_gazepoint_interoperability_versions(). The manifest distinguishes
R packages, Python distributions, supporting Python packages, and external
standards.
gazepoint_interoperability_manifest(include_support = TRUE)gazepoint_interoperability_manifest(include_support = TRUE)
include_support |
Logical. Include NumPy and pandas support rows in addition to the direct interoperability targets. |
A minimum tested version records the oldest version exercised by the maintained interoperability workflow. It is not a claim that every earlier version is incompatible.
A data frame of class
"gazepoint_interoperability_manifest" with one row per target.
manifest <- gazepoint_interoperability_manifest() manifest[, c("target", "dependency", "minimum_tested_version")]manifest <- gazepoint_interoperability_manifest() manifest[, c("target", "dependency", "minimum_tested_version")]
Creates a conservative analysis manifest containing package/session information, input file metadata, output paths, user-supplied parameters, and notes. The function is designed for auditability and does not inspect private data contents.
generate_gazepoint_manifest( input_paths = NULL, parameters = list(), outputs = NULL, notes = NULL, write_path = NULL, include_session_info = TRUE )generate_gazepoint_manifest( input_paths = NULL, parameters = list(), outputs = NULL, notes = NULL, write_path = NULL, include_session_info = TRUE )
input_paths |
Optional character vector of input file or folder paths. |
parameters |
Optional named list of analysis parameters. |
outputs |
Optional character vector of output paths or object names. |
notes |
Optional character vector of free-text notes. |
write_path |
Optional path. Use |
include_session_info |
Logical. If |
A list with class gazepoint_manifest.
Extract stored plot data
get_gazepoint_plot_data(plot)get_gazepoint_plot_data(plot)
plot |
A plot object returned by a gpbiometrics plotting helper. |
A data frame.
Extract stored plot settings
get_gazepoint_plot_settings(plot)get_gazepoint_plot_settings(plot)
plot |
A plot object returned by a gpbiometrics plotting helper. |
A list.
Returns package, R, platform, and session information useful for manuscripts, reproducibility logs, and bug reports.
gpbiometrics_info(print = TRUE, include_session = FALSE)gpbiometrics_info(print = TRUE, include_session = FALSE)
print |
If TRUE, print a compact summary. |
include_session |
If TRUE, include |
A list with package and session metadata.
Reads rectangular Gazepoint CSV exports from a folder and combines files that contain at least one known Gazepoint Biometrics column. This function is designed for all-gaze and fixation-style exports. Multi-section Gazepoint Data Summary files should be parsed separately.
import_gazepoint_biometric_folder( path, pattern = "\\.csv$", recursive = FALSE, include_fixations = TRUE, include_all_gaze = TRUE, include_other_csv = FALSE, na = c("", "NA", "NaN") )import_gazepoint_biometric_folder( path, pattern = "\\.csv$", recursive = FALSE, include_fixations = TRUE, include_all_gaze = TRUE, include_other_csv = FALSE, na = c("", "NA", "NaN") )
path |
Folder containing Gazepoint CSV exports. |
pattern |
Regular expression used to identify candidate CSV files. |
recursive |
Should subfolders be searched? |
include_fixations |
Should files with |
include_all_gaze |
Should files with |
include_other_csv |
Should other CSV files be attempted? The default is
|
na |
Values that should be treated as missing. |
A data frame with all imported rows combined. The output includes a
source_file column and has class "gazepoint_biometrics_folder".
Reads a Gazepoint CSV export containing biometric columns such as GSR, heart rate, interbeat interval, pulse signal, engagement dial, and TTL synchronization fields. The function is conservative: it preserves original column names, removes only empty trailing columns, and attaches a basic biometric-column summary as an attribute.
import_gazepoint_biometrics(file, na = c("", "NA", "NaN"))import_gazepoint_biometrics(file, na = c("", "NA", "NaN"))
file |
Path to a Gazepoint CSV export. |
na |
Values that should be treated as missing. |
A data frame with Gazepoint export columns preserved. The returned
object has class "gazepoint_biometrics" and an attribute named
"biometric_columns".
Loads Gazepoint-style CSV exports from a folder into a named list of data frames. The function is intended as a single entry point for common session folders that contain all-gaze, fixation, summary, biometric, marker, or related exports.
import_gazepoint_data( dir, session = NULL, pattern = "\\.csv$", recursive = FALSE, session_match = c("prefix", "contains", "regex"), file_encoding = "UTF-8-BOM", add_file_info = TRUE )import_gazepoint_data( dir, session = NULL, pattern = "\\.csv$", recursive = FALSE, session_match = c("prefix", "contains", "regex"), file_encoding = "UTF-8-BOM", add_file_info = TRUE )
dir |
Folder containing Gazepoint export files. |
session |
Optional session or participant prefix used to select files. Can be a character vector. |
pattern |
File pattern. Defaults to CSV files. |
recursive |
If TRUE, search subfolders. |
session_match |
How |
file_encoding |
Encoding passed to |
add_file_info |
If TRUE, add source-file columns to each imported data frame. |
A named list of data frames with class gazepoint_session_data.
File metadata are stored in the file_index attribute.
## Not run: session_data <- import_gazepoint_data("path/to/session", session = "P01") names(session_data) attr(session_data, "file_index") ## End(Not run)## Not run: session_data <- import_gazepoint_data("path/to/session", session = "P01") names(session_data) attr(session_data, "file_index") ## End(Not run)
Reads a multi-section Data_Summary_export_*.csv file produced by Gazepoint
Analysis. These files are not ordinary rectangular CSV files. They contain
metadata followed by sections such as AOI Summary and AOI Statistics (for each user). The latter may include AOI-level biometric summaries such as
average dial value, average GSR, average heart rate, average interbeat
interval, and pupil diameter.
import_gazepoint_data_summary(file)import_gazepoint_data_summary(file)
file |
Path to a Gazepoint |
A list with metadata, aoi_summary, and aoi_statistics data
frames. The returned object has class "gazepoint_data_summary".
Reads a CSV/TSV event log and standardizes event identifiers, timestamps, and labels for alignment with Gazepoint biometric or eye-tracking data.
import_gazepoint_event_log( path, time_col = NULL, event_col = NULL, id_col = NULL, sep = NULL, ... )import_gazepoint_event_log( path, time_col = NULL, event_col = NULL, id_col = NULL, sep = NULL, ... )
path |
Path to a CSV/TSV file, or an existing data frame. |
time_col |
Event time column. |
event_col |
Event label column. |
id_col |
Optional event identifier column. |
sep |
Optional delimiter. If NULL, it is guessed from the first line. |
... |
Additional arguments passed to |
Data frame with event_id, event_time, and event_label.
Reads an XDF file through the optional Python pyxdf package via
reticulate. This supports high-end LSL workflows without making Python a
hard dependency of gpbiometrics.
import_gazepoint_lsl_xdf( path, stream_name_pattern = "Gazepoint|GP3|GSR|EDA|Biometric|TTL|Pupil|Gaze", include_all_streams = FALSE, flatten = TRUE, pyxdf_module = "pyxdf" )import_gazepoint_lsl_xdf( path, stream_name_pattern = "Gazepoint|GP3|GSR|EDA|Biometric|TTL|Pupil|Gaze", include_all_streams = FALSE, flatten = TRUE, pyxdf_module = "pyxdf" )
path |
Path to an |
stream_name_pattern |
Regular expression used to identify Gazepoint-like
streams when |
include_all_streams |
Logical. If |
flatten |
Logical. If |
pyxdf_module |
Python module name, usually |
A list with overview, streams, header, and settings.
Import pyHRV-style results
import_gazepoint_pyhrv_results(path)import_gazepoint_pyhrv_results(path)
path |
Input path. Use .json or .rds. |
Imported object.
Interpolates missing values in numeric Gazepoint time series, such as pupil, GSR/EDA, PPG/BVP, heart-rate, IBI/RRI, or other continuous channels. The function can work on a numeric vector, a time-series object, or selected numeric columns of a data frame.
impute_gazepoint_missing( data, method = c("linear", "locf", "nocb", "nearest", "constant"), cols = NULL, time_col = NULL, group_cols = NULL, max_gap = Inf, fill_edges = TRUE, constant_value = 0, add_flags = TRUE, treat_infinite_as_missing = TRUE )impute_gazepoint_missing( data, method = c("linear", "locf", "nocb", "nearest", "constant"), cols = NULL, time_col = NULL, group_cols = NULL, max_gap = Inf, fill_edges = TRUE, constant_value = 0, add_flags = TRUE, treat_infinite_as_missing = TRUE )
data |
Numeric vector, time-series object, or data frame. |
method |
Imputation method: |
cols |
Columns to impute when |
time_col |
Optional time column for interpolation. |
group_cols |
Optional grouping columns. Imputation is performed within groups. |
max_gap |
Maximum missing-gap length, in samples, to impute. Longer
gaps remain missing. Defaults to |
fill_edges |
If TRUE, leading and trailing gaps are filled using the nearest observed value for methods that support it. |
constant_value |
Value used when |
add_flags |
If TRUE and |
treat_infinite_as_missing |
If TRUE, infinite values are treated as missing before imputation. |
Object of the same basic type as data. Data-frame outputs include
an imputation_summary attribute.
x <- c(1, NA, 3, 4) impute_gazepoint_missing(x) dat <- data.frame(time_s = 1:5, GSR = c(1, NA, 3, NA, 5)) impute_gazepoint_missing(dat, cols = "GSR", time_col = "time_s")x <- c(1, NA, 3, 4) impute_gazepoint_missing(x) dat <- data.frame(time_s = 1:5, GSR = c(1, NA, 3, NA, 5)) impute_gazepoint_missing(dat, cols = "GSR", time_col = "time_s")
Interpolates internal blink or dropout spans in pupil columns using transparent, auditable rules. Leading/trailing gaps are not interpolated.
interpolate_gazepoint_pupil_blinks( data, pupil_cols = NULL, time_col = NULL, blink_col = NULL, max_gap_s = NULL, method = c("linear", "constant"), suffix = "_interp" )interpolate_gazepoint_pupil_blinks( data, pupil_cols = NULL, time_col = NULL, blink_col = NULL, max_gap_s = NULL, method = c("linear", "constant"), suffix = "_interp" )
data |
Data frame containing pupil columns. |
pupil_cols |
Pupil columns to interpolate. If omitted, common pupil columns are detected. |
time_col |
Optional time column. |
blink_col |
Optional logical/numeric blink mask column. |
max_gap_s |
Optional maximum interpolated gap duration in seconds. |
method |
Interpolation method passed to |
suffix |
Suffix for interpolated pupil columns. |
Data frame with interpolated pupil columns and audit flags.
Compatibility wrapper for join_gazepoint_biometrics_to_master(). This alias
is provided for users who work with a gp3tools master table and want an
explicit gp3tools-facing function name. The implementation delegates to the
canonical biometric-to-master join helper.
join_gazepoint_biometrics_to_gp3tools(biometrics, gp3tools_master, ...)join_gazepoint_biometrics_to_gp3tools(biometrics, gp3tools_master, ...)
biometrics |
A data frame containing Gazepoint Biometrics samples or summaries. |
gp3tools_master |
A gp3tools-style master eye-tracking data frame. |
... |
Additional arguments passed to
|
The output of join_gazepoint_biometrics_to_master().
biometrics <- data.frame(USER = rep("P1", 3), CNT = 1:3, HR = c(70, 71, 72)) master <- data.frame(USER = rep("P1", 3), CNT = 1:3, AOI = c("A", "B", "A")) join_gazepoint_biometrics_to_gp3tools( biometrics, master, by = c("USER", "CNT") )biometrics <- data.frame(USER = rep("P1", 3), CNT = 1:3, HR = c(70, 71, 72)) master <- data.frame(USER = rep("P1", 3), CNT = 1:3, AOI = c("A", "B", "A")) join_gazepoint_biometrics_to_gp3tools( biometrics, master, by = c("USER", "CNT") )
Convenience wrapper around sync_gazepoint_biometrics_with_gaze() for joining
biometric data to a gp3tools-style master table or any other analysis-ready
gaze table.
join_gazepoint_biometrics_to_master(master, biometrics, by, all_x = TRUE)join_gazepoint_biometrics_to_master(master, biometrics, by, all_x = TRUE)
master |
A master gaze or analysis table. |
biometrics |
A Gazepoint Biometrics data frame. |
by |
Character vector of key columns used for joining. |
all_x |
Logical. Should all rows from |
A data frame with biometric columns joined to the master table.
Aligns event logs to Gazepoint biometric or eye-tracking data and returns either sample-level event windows or event-level summary features.
match_gazepoint_events_to_biometrics( data, events, pre = 0, post = 5, time_col = NULL, event_time_col = NULL, event_id_col = NULL, summary_cols = NULL, return = c("windows", "summary") )match_gazepoint_events_to_biometrics( data, events, pre = 0, post = 5, time_col = NULL, event_time_col = NULL, event_id_col = NULL, summary_cols = NULL, return = c("windows", "summary") )
data |
Biometric or eye-tracking data frame. |
events |
Event timestamps, event data frame, or event-log path. |
pre |
Seconds before event onset. |
post |
Seconds after event onset. |
time_col |
Time column in |
event_time_col |
Event-time column in |
event_id_col |
Event identifier column in |
summary_cols |
Numeric columns to summarize when |
return |
|
Data frame of sample-level windows or event-level summaries.
Merge multiple Gazepoint recordings PsPM-style
merge_gazepoint_recordings_pspm_style( recordings, time_col = NULL, gap_seconds = 1, recording_col = "pspm_recording", reset_first_time = TRUE )merge_gazepoint_recordings_pspm_style( recordings, time_col = NULL, gap_seconds = 1, recording_col = "pspm_recording", reset_first_time = TRUE )
recordings |
List of data frames. |
time_col |
Time column. |
gap_seconds |
Gap inserted between recordings. |
recording_col |
Output recording-id column. |
reset_first_time |
If TRUE, each input time starts from zero before offsetting. |
Merged data frame.
Creates event-time, inter-event interval, and inverse-Gaussian-style summary tables for EDA/SCR events. Events can be supplied directly through an event column or derived from positive EDA-derivative bursts.
model_gazepoint_eda_point_process( dat, eda_col = "GSR_US", time_col = "CNT", group_cols = NULL, event_time_col = NULL, event_indicator_col = NULL, derivative_mad_multiplier = 6, min_event_distance_s = 1 )model_gazepoint_eda_point_process( dat, eda_col = "GSR_US", time_col = "CNT", group_cols = NULL, event_time_col = NULL, event_indicator_col = NULL, derivative_mad_multiplier = 6, min_event_distance_s = 1 )
dat |
A data frame. |
eda_col |
Numeric EDA column. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns. |
event_time_col |
Optional column of event onset times. |
event_indicator_col |
Optional binary event indicator column. |
derivative_mad_multiplier |
MAD multiplier for derivative-derived events. |
min_event_distance_s |
Minimum distance between derived events. |
This function is a compact point-process summary/model-preparation helper. It does not fit a full latent sympathetic state-space model.
A list with overview, event_table, interval_table,
process_summary, and settings.
Creates beat-time, interbeat interval, and inverse-Gaussian-style summary tables from IBI/RR intervals. This is a compact point-process model-preparation helper, not a full adaptive Bayesian heartbeat filter.
model_gazepoint_hr_point_process( dat, ibi_col = "IBI", time_col = NULL, beat_time_col = NULL, group_cols = NULL, ibi_units = c("auto", "seconds", "milliseconds") )model_gazepoint_hr_point_process( dat, ibi_col = "IBI", time_col = NULL, beat_time_col = NULL, group_cols = NULL, ibi_units = c("auto", "seconds", "milliseconds") )
dat |
A data frame. |
ibi_col |
Numeric IBI/RR interval column. |
time_col |
Optional time column. |
beat_time_col |
Optional explicit beat-time column. |
group_cols |
Optional grouping columns. |
ibi_units |
|
A list with overview, beat_table, interval_table,
process_summary, and settings.
Builds an impulse-train representation of heartbeat timing from IBI/RR intervals or beat times and computes a simple spectrum of the resulting impulse train. This is an IPFM-style model-preparation helper, not a perfect reconstruction of sinoatrial-node physiology.
model_gazepoint_hrv_ipfm( dat, ibi_col = "IBI", beat_time_col = NULL, group_cols = NULL, ibi_units = c("auto", "seconds", "milliseconds"), output_sampling_rate = 4, max_frequency = 0.5 )model_gazepoint_hrv_ipfm( dat, ibi_col = "IBI", beat_time_col = NULL, group_cols = NULL, ibi_units = c("auto", "seconds", "milliseconds"), output_sampling_rate = 4, max_frequency = 0.5 )
dat |
A data frame. |
ibi_col |
Optional numeric IBI/RR interval column. |
beat_time_col |
Optional explicit beat-time column. |
group_cols |
Optional grouping columns. |
ibi_units |
|
output_sampling_rate |
Sampling rate for regular impulse train in Hz. |
max_frequency |
Maximum frequency returned in spectrum. |
A list with overview, beat_table, impulse_table,
spectrum_table, summary, and settings.
Normalizes SCR amplitudes using z-scores, percent of maximum, min-max range, centered scores, log-z scores, or no transformation.
normalize_gazepoint_scr( amplitudes, method = c("z", "percent_max", "range", "center", "log_z", "none"), amplitude_col = NULL, group_cols = NULL, output_col = "scr_amplitude_normalized", na.rm = TRUE )normalize_gazepoint_scr( amplitudes, method = c("z", "percent_max", "range", "center", "log_z", "none"), amplitude_col = NULL, group_cols = NULL, output_col = "scr_amplitude_normalized", na.rm = TRUE )
amplitudes |
Numeric vector or data frame. |
method |
Normalization method: |
amplitude_col |
Column to normalize when |
group_cols |
Optional grouping columns for subject-specific normalization. |
output_col |
Name of normalized column for data-frame input. |
na.rm |
If TRUE, ignore missing values when computing normalization constants. |
Numeric vector for vector input, or data frame for data-frame input.
normalize_gazepoint_scr(c(0.1, 0.2, 0.3), method = "percent_max")normalize_gazepoint_scr(c(0.1, 0.2, 0.3), method = "percent_max")
Performs a dependency-light grid search over the slow Bateman impulse-response time constant used in cvxEDA-style EDA decomposition workflows. The default fast time constant is fixed at 0.7 seconds and the slow time constant is searched between 2 and 4 seconds. This function does not run the original cvxEDA optimisation; it provides a subject-specific tau-selection bridge for downstream cvxEDA-style workflows.
optimize_gazepoint_cvxeda_tau( dat, eda_col = "GSR_US", time_col = "CNT", group_cols = NULL, tau0_grid = seq(2, 4, by = 0.25), tau1 = 0.7, sampling_rate = NULL, ridge_lambda = 0.01, max_irf_seconds = 20 )optimize_gazepoint_cvxeda_tau( dat, eda_col = "GSR_US", time_col = "CNT", group_cols = NULL, tau0_grid = seq(2, 4, by = 0.25), tau1 = 0.7, sampling_rate = NULL, ridge_lambda = 0.01, max_irf_seconds = 20 )
dat |
A data frame containing EDA data. |
eda_col |
Numeric EDA/conductance column. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns, usually participant/session. |
tau0_grid |
Candidate slow time constants. |
tau1 |
Fixed fast time constant. |
sampling_rate |
Optional sampling rate in Hz. If |
ridge_lambda |
Small ridge penalty used in frequency-domain deconvolution. |
max_irf_seconds |
Maximum impulse-response duration. |
A list with overview, best_tau, optimization_table, and
settings.
Build a multimodal physiology validation ladder
physiology_validation_ladder( acquisition_qc = "not_assessed", analytical_qc = "not_assessed", construct_check = "not_assessed", within_person = "not_assessed", held_out_person = "not_assessed", claim = "descriptive" )physiology_validation_ladder( acquisition_qc = "not_assessed", analytical_qc = "not_assessed", construct_check = "not_assessed", within_person = "not_assessed", held_out_person = "not_assessed", claim = "descriptive" )
acquisition_qc, analytical_qc, construct_check, within_person, held_out_person
|
Stage statuses: |
claim |
Claim type. |
A structured validation result.
Aggregates participant-, session-, or row-level Gazepoint QC outputs into a compact static dashboard object. The function is intentionally conservative: it summarizes existing QC indicators, missingness rates, signal-quality scores, rule failures, exclusion flags, and audit notes without fitting models, making clinical claims, or launching an interactive dashboard.
pipeline_comparison_dashboard( data, participant_col = NULL, session_col = NULL, grouping_cols = NULL, missingness_col = NULL, quality_col = NULL, qc_status_col = NULL, failed_rules_col = NULL, excluded_col = NULL, notes_col = NULL )pipeline_comparison_dashboard( data, participant_col = NULL, session_col = NULL, grouping_cols = NULL, missingness_col = NULL, quality_col = NULL, qc_status_col = NULL, failed_rules_col = NULL, excluded_col = NULL, notes_col = NULL )
data |
A data frame containing QC, quality, missingness, exclusion, or audit-summary columns. |
participant_col |
Optional participant identifier column. If |
session_col |
Optional session identifier column. If |
grouping_cols |
Optional character vector of grouping columns. If supplied,
this overrides |
missingness_col |
Optional numeric missingness-rate column. |
quality_col |
Optional numeric quality-score or SQI column. |
qc_status_col |
Optional QC status column. |
failed_rules_col |
Optional column containing failed rule labels. |
excluded_col |
Optional logical, numeric, or character exclusion flag column. |
notes_col |
Optional audit-note column. |
A list with class gazepoint_pipeline_comparison_dashboard containing
an overall summary, grouped dashboard table, issue table, and detected column
mapping.
Plots AOI-biometric summary values as a ggplot object.
plot_gazepoint_aoi_biometrics( x, value_col = "mean_value", aoi_col = "aoi_label", signal_col = "signal", group_col = NULL, plot_type = c("boxplot", "point", "line"), title = NULL )plot_gazepoint_aoi_biometrics( x, value_col = "mean_value", aoi_col = "aoi_label", signal_col = "signal", group_col = NULL, plot_type = c("boxplot", "point", "line"), title = NULL )
x |
A |
value_col |
Value column to plot. |
aoi_col |
AOI label column. |
signal_col |
Signal label column. |
group_col |
Optional grouping column. |
plot_type |
|
title |
Optional plot title. |
A ggplot object with plot data stored in attributes.
Plots and summarises biometric quality indicators such as dropout flags, validity flags, missingness flags, and quality/audit flags. When no explicit quality columns are available, the function can derive missingness indicators from detected biometric signal columns.
plot_gazepoint_biometric_quality( data, quality_cols = NULL, signal_cols = NULL, time_col = NULL, group_col = NULL, dropout_prefix = "biometric_dropout", max_points = 5000L, main = NULL, plot = TRUE, ... )plot_gazepoint_biometric_quality( data, quality_cols = NULL, signal_cols = NULL, time_col = NULL, group_col = NULL, dropout_prefix = "biometric_dropout", max_points = 5000L, main = NULL, plot = TRUE, ... )
data |
A data frame. |
quality_cols |
Optional quality/flag columns. If |
signal_cols |
Optional signal columns used to derive missingness flags when no quality columns are detected. |
time_col |
Optional time/order column recorded in the returned settings. |
group_col |
Optional grouping column for group-level quality summaries. |
dropout_prefix |
Prefix used by dropout columns created by
|
max_points |
Maximum number of rows used for row-level returned plot data. |
main |
Optional plot title. |
plot |
Logical. If |
... |
Additional arguments passed to |
A list with overview, quality_summary, group_summary,
plot_data, and settings.
df <- data.frame( CNT = 1:5, GSR = c(1, NA, 1.2, 1.1, NA), HR_valid = c(1, 1, 0, 1, 1) ) plot_gazepoint_biometric_quality(df, signal_cols = "GSR", plot = FALSE)df <- data.frame( CNT = 1:5, GSR = c(1, NA, 1.2, 1.1, NA), HR_valid = c(1, 1, 0, 1, 1) ) plot_gazepoint_biometric_quality(df, signal_cols = "GSR", plot = FALSE)
Creates a lightweight dashboard object containing QC plots for signal activity and time-reset diagnostics. This is a structured list of ggplot objects, not a Shiny application. The dashboard is intended for report preparation and manual QC review.
plot_gazepoint_biometric_report_dashboard( data = NULL, signal_activity = NULL, time_resets = NULL, signal_cols = NULL, group_cols = NULL, time_col = NULL, include_signal_activity = TRUE, include_time_resets = TRUE, max_groups = 30, continue_on_error = TRUE, title_prefix = "Gazepoint biometric QC" )plot_gazepoint_biometric_report_dashboard( data = NULL, signal_activity = NULL, time_resets = NULL, signal_cols = NULL, group_cols = NULL, time_col = NULL, include_signal_activity = TRUE, include_time_resets = TRUE, max_groups = 30, continue_on_error = TRUE, title_prefix = "Gazepoint biometric QC" )
data |
Optional Gazepoint biometric data frame. |
signal_activity |
Optional result from
|
time_resets |
Optional result from |
signal_cols |
Optional signal columns used when computing signal
activity from |
group_cols |
Optional grouping columns. |
time_col |
Optional time or counter column. |
include_signal_activity |
If |
include_time_resets |
If |
max_groups |
Maximum number of groups to display in each plot. |
continue_on_error |
If |
title_prefix |
Optional title prefix. |
A list with overview, plots, errors, inputs, and settings.
Plots one or more Gazepoint biometric signals using base R graphics and returns the plotted data and signal summary. The helper is intentionally descriptive and does not infer emotional valence, cognition, or HRV from raw biometric columns.
plot_gazepoint_biometric_signals( data, signal_cols = NULL, time_col = NULL, group_col = NULL, max_points = 5000L, standardize = FALSE, type = c("line", "points", "both"), main = NULL, xlab = NULL, ylab = NULL, legend = TRUE, plot = TRUE, ... )plot_gazepoint_biometric_signals( data, signal_cols = NULL, time_col = NULL, group_col = NULL, max_points = 5000L, standardize = FALSE, type = c("line", "points", "both"), main = NULL, xlab = NULL, ylab = NULL, legend = TRUE, plot = TRUE, ... )
data |
A data frame. |
signal_cols |
Optional character vector of signal columns. If |
time_col |
Optional time/order column for the x-axis. If |
group_col |
Optional grouping column recorded in the returned overview. The current plotting implementation overlays the selected rows rather than faceting by group. |
max_points |
Maximum number of rows to plot. Large data are evenly downsampled for display only; returned summaries still describe the input signal columns. |
standardize |
Logical. Should each signal be z-standardised before plotting? This is useful when signals are on different scales. |
type |
Plot type: |
main |
Optional plot title. |
xlab |
Optional x-axis label. |
ylab |
Optional y-axis label. |
legend |
Logical. Should a legend be drawn when more than one signal is plotted? |
plot |
Logical. If |
... |
Additional arguments passed to |
A list with overview, plot_data, signal_summary, and settings.
df <- data.frame( CNT = 1:5, GSR = c(1, 1.1, 1.2, 1.1, 1), HR = c(70, 71, 72, 71, 70) ) plot_gazepoint_biometric_signals(df, time_col = "CNT", plot = FALSE)df <- data.frame( CNT = 1:5, GSR = c(1, 1.1, 1.2, 1.1, 1), HR = c(70, 71, 72, 71, 70) ) plot_gazepoint_biometric_signals(df, time_col = "CNT", plot = FALSE)
Plots the permutation null distribution of maximum cluster masses and, when available, overlays the observed cluster mass for one observed cluster.
plot_gazepoint_cluster_null_distribution( result, cluster_id = 1L, observed_mass = NULL, bins = 30L )plot_gazepoint_cluster_null_distribution( result, cluster_id = 1L, observed_mass = NULL, bins = 30L )
result |
Object returned by |
cluster_id |
Observed cluster to overlay. |
observed_mass |
Optional observed cluster mass. If |
bins |
Number of histogram bins. |
A ggplot object.
Plots condition-level time courses and highlights clusters that pass the cluster-level alpha threshold. The shaded regions are descriptive aids only; they should not be interpreted as precise effect onset or offset estimates.
plot_gazepoint_cluster_permutation(x, alpha = NULL, show_all_clusters = FALSE)plot_gazepoint_cluster_permutation(x, alpha = NULL, show_all_clusters = FALSE)
x |
Object returned by |
alpha |
Optional cluster-level alpha. If |
show_all_clusters |
Logical. If |
A ggplot object.
Create compact diagnostic plots from design, condition-balance, or event-coverage audit objects.
plot_gazepoint_design_coverage( audit, type = c("condition_counts", "participant_trials", "event_coverage", "warnings") )plot_gazepoint_design_coverage( audit, type = c("condition_counts", "participant_trials", "event_coverage", "warnings") )
audit |
Object returned by |
type |
Plot type. Supported values depend on the audit object:
|
A ggplot object.
Plots available EDA/GSR decomposition channels, typically GSR_US,
GSR_US_TONIC, and GSR_US_PHASIC, as a ggplot object.
plot_gazepoint_eda_decomposition( data, time_col = NULL, signal_cols = NULL, group_cols = NULL, standardise = FALSE, max_points = 5000, title = NULL )plot_gazepoint_eda_decomposition( data, time_col = NULL, signal_cols = NULL, group_cols = NULL, standardise = FALSE, max_points = 5000, title = NULL )
data |
A Gazepoint biometric data frame or list containing a data frame. |
time_col |
Optional time/counter column. |
signal_cols |
Optional signal columns to plot. |
group_cols |
Optional grouping columns used for facets. |
standardise |
Logical. If |
max_points |
Maximum number of rows retained after simple downsampling. |
title |
Optional plot title. |
A ggplot object with plot data stored in attributes.
Creates a dependency-light EDA-gram-style representation using sliding-window spectral power. This is inspired by EDA-gram visualisations, but it does not implement a full sparse dictionary decomposition unless such a model is supplied externally.
plot_gazepoint_eda_gram( dat, eda_col = "GSR_US", time_col = "CNT", group_cols = NULL, group_id_to_plot = NULL, sampling_rate = NULL, window_seconds = 30, step_seconds = 5, frequency_range = c(0.01, 0.5), frequency_bins = 64, log_power = TRUE, plot = TRUE, main = "EDA-gram" )plot_gazepoint_eda_gram( dat, eda_col = "GSR_US", time_col = "CNT", group_cols = NULL, group_id_to_plot = NULL, sampling_rate = NULL, window_seconds = 30, step_seconds = 5, frequency_range = c(0.01, 0.5), frequency_bins = 64, log_power = TRUE, plot = TRUE, main = "EDA-gram" )
dat |
A data frame containing EDA data. |
eda_col |
Numeric EDA/conductance column. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns. |
group_id_to_plot |
Optional group ID to plot. If |
sampling_rate |
Optional sampling rate in Hz. If |
window_seconds |
Sliding-window length. |
step_seconds |
Sliding-window step. |
frequency_range |
Frequency range shown in Hz. |
frequency_bins |
Number of frequency bins. |
log_power |
Logical. If |
plot |
Logical. If |
main |
Plot title. |
Invisibly returns a list with overview, gram_table,
plot_matrix, and settings.
Create compact plots for file extensions, detected column roles, mean missingness, or numeric signal activity.
plot_gazepoint_export_profile( profile, type = c("files", "roles", "missingness", "activity"), top_n = 20 )plot_gazepoint_export_profile( profile, type = c("files", "roles", "missingness", "activity"), top_n = 20 )
profile |
Object returned by |
type |
Plot type. One of |
top_n |
Number of columns or files to show for selected plots. |
A ggplot object.
Creates a heatmap-style plot showing missing and observed samples across selected Gazepoint signal columns. This is a descriptive quality-control display and should not be interpreted as evidence of psychological or physiological state.
plot_gazepoint_missingness( data, cols = NULL, time_col = NULL, id_col = NULL, max_points = 5000L )plot_gazepoint_missingness( data, cols = NULL, time_col = NULL, id_col = NULL, max_points = 5000L )
data |
A data frame. |
cols |
Character vector naming columns to inspect. If |
time_col |
Optional column used for the x-axis. If |
id_col |
Optional participant/session column used for faceting. |
max_points |
Maximum number of rows to plot. Larger data sets are evenly down-sampled for display only. |
A ggplot object.
d <- data.frame( time = 1:5, pupil_left = c(3, NA, 3.1, 3.2, NA), eda = c(1, 1.1, NA, 1.2, 1.3) ) plot_gazepoint_missingness(d, cols = c("pupil_left", "eda"), time_col = "time")d <- data.frame( time = 1:5, pupil_left = c(3, NA, 3.1, 3.2, NA), eda = c(1, 1.1, NA, 1.2, 1.3) ) plot_gazepoint_missingness(d, cols = c("pupil_left", "eda"), time_col = "time")
Creates a conservative timeline plot for one or more biometric channels. The plot is intended for inspection, synchronization checks, and reporting support. It does not interpret electrodermal activity as emotional valence.
plot_gazepoint_multimodal_timeline( data, time_col = NULL, signal_cols = NULL, group_cols = NULL, participant_col = NULL, stimulus_col = NULL, trial_col = NULL, event_time_col = NULL, event_col = NULL, standardise = TRUE, show_event_markers = TRUE, title = NULL )plot_gazepoint_multimodal_timeline( data, time_col = NULL, signal_cols = NULL, group_cols = NULL, participant_col = NULL, stimulus_col = NULL, trial_col = NULL, event_time_col = NULL, event_col = NULL, standardise = TRUE, show_event_markers = TRUE, title = NULL )
data |
A data frame containing biometric samples or aligned biometric rows. |
time_col |
Optional time column. If |
signal_cols |
Optional biometric signal columns. If |
group_cols |
Optional grouping columns used to separate trajectories. |
participant_col, stimulus_col, trial_col
|
Optional common grouping columns
to add to |
event_time_col |
Optional column containing event times for vertical markers. |
event_col |
Optional event/TTL indicator column used for vertical markers. |
standardise |
Logical. If |
show_event_markers |
Logical. Should event markers be drawn when available? |
title |
Optional plot title. |
A ggplot object with the long plotting data stored in the plot_data
attribute and settings stored in the settings attribute.
Plot breathing-rate spectrum from Gazepoint RR/IBI intervals
plot_gazepoint_ppg_breathing( rr_ms, rr_time_s = NULL, resample_hz = 4, breathing_band = c(0.1, 0.5) )plot_gazepoint_ppg_breathing( rr_ms, rr_time_s = NULL, resample_hz = 4, breathing_band = c(0.1, 0.5) )
rr_ms |
RR/IBI intervals in milliseconds. |
rr_time_s |
Optional interval timestamps. |
resample_hz |
RR interpolation frequency. |
breathing_band |
Breathing frequency band. |
Invisibly returns breathing-rate object.
Plot Gazepoint pulse/PPG peak detection results
plot_gazepoint_ppg_peak_detection( detection, group = NULL, accepted_only = FALSE )plot_gazepoint_ppg_peak_detection( detection, group = NULL, accepted_only = FALSE )
detection |
Detection object returned by detect_gazepoint_ppg_peaks(). |
group |
Optional group to plot. |
accepted_only |
Whether to show only accepted peaks. |
Invisibly returns the plotted data.
Plot a Poincare plot from Gazepoint pulse/PPG peaks or RR intervals
plot_gazepoint_ppg_poincare(peaks = NULL, rr_ms = NULL, group_col = "group")plot_gazepoint_ppg_poincare(peaks = NULL, rr_ms = NULL, group_col = "group")
peaks |
Optional peak table. |
rr_ms |
Optional RR/IBI intervals in milliseconds. |
group_col |
Group column when peaks are supplied. |
Invisibly returns plotting data and Poincare summaries.
Plot segmentwise Gazepoint pulse/PPG measures
plot_gazepoint_ppg_segmentwise(segmentwise, measure = "bpm")plot_gazepoint_ppg_segmentwise(segmentwise, measure = "bpm")
segmentwise |
Object returned by process_gazepoint_ppg_segmentwise(). |
measure |
Measure column to plot. |
Invisibly returns plotted data.
Plot pyHRV-style heart-rate heatplot
plot_gazepoint_pyhrv_hr_heatplot(nni_ms, time_bins = 20, hr_bins = 20)plot_gazepoint_pyhrv_hr_heatplot(nni_ms, time_bins = 20, hr_bins = 20)
nni_ms |
Numeric NN intervals in milliseconds. |
time_bins |
Number of time bins. |
hr_bins |
Number of heart-rate bins. |
Invisibly returns heatplot data.
Plot pyHRV-style radar chart
plot_gazepoint_pyhrv_radar_chart( measures, columns = c("sdnn", "rmssd", "sdsd", "pnn50", "lf_norm", "hf_norm", "sd1", "sd2") )plot_gazepoint_pyhrv_radar_chart( measures, columns = c("sdnn", "rmssd", "sdsd", "pnn50", "lf_norm", "hf_norm", "sd1", "sd2") )
measures |
Named numeric vector or one-row data frame. |
columns |
Optional columns to plot. |
Invisibly returns plotted values.
Plot pyHRV-style tachogram
plot_gazepoint_pyhrv_tachogram(nni_ms, time_s = NULL)plot_gazepoint_pyhrv_tachogram(nni_ms, time_s = NULL)
nni_ms |
Numeric NN intervals in milliseconds. |
time_s |
Optional time vector. |
Invisibly returns plotted data.
Plots saccade amplitude against peak velocity. The function expects saccade-level amplitude and peak-velocity columns. If raw sample-level data are supplied, users should first derive saccade-level kinematics with a validated fixation/saccade detector.
plot_gazepoint_saccade_main_sequence( dat, amplitude_col = NULL, peak_velocity_col = NULL, group_col = NULL, log_axes = TRUE, add_smoother = TRUE, main = "Gazepoint saccade main-sequence diagnostic" )plot_gazepoint_saccade_main_sequence( dat, amplitude_col = NULL, peak_velocity_col = NULL, group_col = NULL, log_axes = TRUE, add_smoother = TRUE, main = "Gazepoint saccade main-sequence diagnostic" )
dat |
A saccade-level data frame. |
amplitude_col |
Saccade amplitude column. |
peak_velocity_col |
Peak velocity column. |
group_col |
Optional grouping column. |
log_axes |
Logical. If |
add_smoother |
Logical. If |
main |
Plot title. |
Invisibly returns the plotted data and settings.
Plots an EDA/GSR signal with detected SCR peak markers and optional event onsets from SCR event-window summaries or event tables.
plot_gazepoint_scr_events( data, scr_peaks, event_windows = NULL, events = NULL, time_col = NULL, signal_col = NULL, phasic_col = NULL, group_cols = NULL, show_events = TRUE, max_points = 5000, title = NULL )plot_gazepoint_scr_events( data, scr_peaks, event_windows = NULL, events = NULL, time_col = NULL, signal_col = NULL, phasic_col = NULL, group_cols = NULL, show_events = TRUE, max_points = 5000, title = NULL )
data |
Gazepoint biometric data frame. |
scr_peaks |
A |
event_windows |
Optional |
events |
Optional event table used when |
time_col |
Optional time/counter column. |
signal_col |
Optional signal column to plot. |
phasic_col |
Optional preferred phasic signal column. |
group_cols |
Optional grouping columns used for facets and matching. |
show_events |
Logical. If |
max_points |
Maximum number of signal rows retained after downsampling. |
title |
Optional plot title. |
A ggplot object with plot data stored in attributes.
Plots a specification-curve style display from the output of
run_gazepoint_scr_multiverse() or from a compatible data frame.
plot_gazepoint_scr_specification_curve( x, estimate_col = NULL, specification_col = "specification_id", add_zero_line = TRUE, main = "SCR specification curve" )plot_gazepoint_scr_specification_curve( x, estimate_col = NULL, specification_col = "specification_id", add_zero_line = TRUE, main = "SCR specification curve" )
x |
Output from |
estimate_col |
Column to rank and plot. Defaults to
|
specification_col |
Specification identifier column. |
add_zero_line |
Logical. If |
main |
Plot title. |
Invisibly returns a list with plot data and settings.
Plots signal-activity summaries produced by
audit_gazepoint_signal_activity(), or computes them from a biometric data
frame. The plot is intended for quality-control review of signal
availability, missingness, zero activity, and basic activity status. It does
not infer emotion, valence, cognition, preference, trust, or physiological
diagnosis.
plot_gazepoint_signal_activity( data, signal_cols = NULL, group_cols = NULL, metric = c("active_signal", "nonzero_prop", "missing_prop", "n_unique_finite"), max_groups = 30, title = NULL )plot_gazepoint_signal_activity( data, signal_cols = NULL, group_cols = NULL, metric = c("active_signal", "nonzero_prop", "missing_prop", "n_unique_finite"), max_groups = 30, title = NULL )
data |
A Gazepoint biometric data frame, or an
|
signal_cols |
Optional signal columns used when |
group_cols |
Optional grouping columns used when |
metric |
Summary metric to plot. |
max_groups |
Maximum number of groups to display. |
title |
Optional plot title. |
A ggplot object with the package plot contract attached.
Creates a lightweight ggplot diagnostic for signal-quality metrics or labels. The plot is intended for quality control and audit reporting only.
plot_gazepoint_signal_quality( quality, metric = "prop_missing", x = NULL, colour = NULL, facet = NULL )plot_gazepoint_signal_quality( quality, metric = "prop_missing", x = NULL, colour = NULL, facet = NULL )
quality |
A data frame returned by
|
metric |
Metric to plot. Use |
x |
Optional x-axis column. If omitted, the function uses the first available column among participant, participant_id, trial, trial_id, segment, segment_id, session, or signal. |
colour |
Optional colour/grouping column. |
facet |
Optional faceting column. Defaults to |
A ggplot object.
Plots row-level time/counter progression and flags from
audit_gazepoint_time_resets(), or computes them from a biometric data
frame. The plot is intended for synchronization and file-structure QC. It
does not establish causal timing or true physiological latency.
plot_gazepoint_time_resets( data, time_col = NULL, group_cols = NULL, max_groups = 30, title = NULL )plot_gazepoint_time_resets( data, time_col = NULL, group_cols = NULL, max_groups = 30, title = NULL )
data |
A Gazepoint biometric data frame, or an
|
time_col |
Optional time or counter column used when |
group_cols |
Optional grouping columns used when |
max_groups |
Maximum number of groups to display. |
title |
Optional plot title. |
A ggplot object with the package plot contract attached.
Uses H0 persistence lifetimes, represented by Euclidean minimum-spanning-tree edge lengths over a delay embedding. The output is explicitly a structural waveform descriptor, not a direct physiological surrogate.
ppg_topology_features(signal, delay = 2L, dimension = 3L, max_points = 300L)ppg_topology_features(signal, delay = 2L, dimension = 3L, max_points = 300L)
signal |
Numeric PPG signal. |
delay |
Embedding delay in samples. |
dimension |
Embedding dimension. |
max_points |
Maximum embedded points used by the diagnostic. |
A named list of topology-aware structural summaries.
Converts AOI-biometric summaries into a modelling-ready table for GLM/LMM/GLMM workflows.
prepare_gazepoint_aoi_biometrics_model_data( x, outcome_col = "mean_value", predictor_cols = c("aoi_label", "signal"), factor_cols = c("aoi_label", "signal"), numeric_cols = NULL, group_cols = NULL, drop_missing_outcome = TRUE, min_rows = NULL, standardise_outcome = FALSE, standardise_within = c("signal", "all") )prepare_gazepoint_aoi_biometrics_model_data( x, outcome_col = "mean_value", predictor_cols = c("aoi_label", "signal"), factor_cols = c("aoi_label", "signal"), numeric_cols = NULL, group_cols = NULL, drop_missing_outcome = TRUE, min_rows = NULL, standardise_outcome = FALSE, standardise_within = c("signal", "all") )
x |
A |
outcome_col |
Outcome column to model. |
predictor_cols |
Optional predictor columns to retain. |
factor_cols |
Optional columns converted to factors. |
numeric_cols |
Optional columns converted to numeric. |
group_cols |
Optional grouping columns for random-effect formulas. |
drop_missing_outcome |
Logical. If |
min_rows |
Optional minimum contributing rows required. |
standardise_outcome |
Logical. If |
standardise_within |
Standardization scope used when
|
A list with overview, model_data, variable_summary,
model_formulas, and settings.
Creates segment-level features that can be passed to a user-supplied artifact classifier such as an SVM. No pretrained classifier is bundled.
prepare_gazepoint_artifact_svm_features( dat, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, segment_seconds = 5, samples_per_segment = NULL, sampling_rate = NULL )prepare_gazepoint_artifact_svm_features( dat, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, segment_seconds = 5, samples_per_segment = NULL, sampling_rate = NULL )
dat |
A data frame. |
eda_col |
EDA/conductance column. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
segment_seconds |
Segment length in seconds when |
samples_per_segment |
Segment length in samples when no usable time column or sampling rate is available. |
sampling_rate |
Optional sampling rate in Hz. |
A segment-level feature data frame.
A modality-specific convenience wrapper around
export_gazepoint_to_bids(). Arguments are forwarded without changing the
unified export contract. When the unified exporter exposes modality switches,
they are set to eye-tracking mode automatically.
prepare_gazepoint_bids_eye(data, ..., execute = TRUE)prepare_gazepoint_bids_eye(data, ..., execute = TRUE)
data |
Gazepoint eye-tracking data accepted by
|
... |
Additional arguments forwarded to |
execute |
If |
The result of export_gazepoint_to_bids() or a dry-run specification.
A modality-specific convenience wrapper around
export_gazepoint_to_bids(). Arguments are forwarded without changing the
unified export contract. When the unified exporter exposes modality switches,
they are set to physiology mode automatically.
prepare_gazepoint_bids_physio(data, ..., execute = TRUE)prepare_gazepoint_bids_physio(data, ..., execute = TRUE)
data |
Gazepoint physiological data accepted by
|
... |
Additional arguments forwarded to |
execute |
If |
The result of export_gazepoint_to_bids() or a dry-run specification.
Prepares biometric window-level or event-level summaries for downstream mixed-model analysis. This helper does not fit a model. It checks variables, optionally baseline-corrects the selected outcome, optionally scales numeric predictors, converts grouping/factor variables, flags complete cases, and returns a conservative model formula.
prepare_gazepoint_biometrics_lme_data( data, outcome_col, fixed_effect_cols = NULL, condition_cols = NULL, covariate_cols = NULL, random_effect_cols = NULL, participant_col = NULL, stimulus_col = NULL, trial_col = NULL, window_col = NULL, baseline_col = NULL, baseline_correct = FALSE, factor_cols = NULL, continuous_cols = NULL, scale_continuous = FALSE, include_window = TRUE, drop_missing = TRUE, min_rows = 10 )prepare_gazepoint_biometrics_lme_data( data, outcome_col, fixed_effect_cols = NULL, condition_cols = NULL, covariate_cols = NULL, random_effect_cols = NULL, participant_col = NULL, stimulus_col = NULL, trial_col = NULL, window_col = NULL, baseline_col = NULL, baseline_correct = FALSE, factor_cols = NULL, continuous_cols = NULL, scale_continuous = FALSE, include_window = TRUE, drop_missing = TRUE, min_rows = 10 )
data |
A data frame containing biometric summary rows. |
outcome_col |
Name of the outcome column to analyse. |
fixed_effect_cols |
Optional fixed-effect predictor columns. |
condition_cols |
Optional condition/design columns to include as fixed effects. |
covariate_cols |
Optional covariate columns to include as fixed effects. |
random_effect_cols |
Optional grouping columns for random intercepts. |
participant_col, stimulus_col, trial_col
|
Optional common grouping columns. |
window_col |
Optional analysis-window column. Included as a fixed effect
when |
baseline_col |
Optional baseline column. |
baseline_correct |
Logical. If |
factor_cols |
Optional columns to convert to factors. |
continuous_cols |
Optional numeric predictor columns to scale when
|
scale_continuous |
Logical. If |
include_window |
Logical. Should |
drop_missing |
Logical. Should incomplete model rows be removed from
|
min_rows |
Minimum number of complete rows required for a |
A list with overview, data, model_data, model_formula,
variable_summary, and settings.
Converts Gazepoint EDA/GSR or PPG/BVP waveform data into grouped numeric vectors suitable for transfer to Python BioSPPy. The function validates the timebase, records missing-data handling, and can write headerless one-column CSV files.
prepare_gazepoint_biosppy_input( data, signal_type = c("auto", "eda", "ppg"), signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, missing = c("error", "interpolate", "segments"), irregular = c("error", "allow"), sampling_tolerance = 0.05, min_segment_samples = 3L, signal_units = NULL, output_dir = NULL, prefix = "gazepoint_biosppy", write_manifest = TRUE, overwrite = FALSE )prepare_gazepoint_biosppy_input( data, signal_type = c("auto", "eda", "ppg"), signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, missing = c("error", "interpolate", "segments"), irregular = c("error", "allow"), sampling_tolerance = 0.05, min_segment_samples = 3L, signal_units = NULL, output_dir = NULL, prefix = "gazepoint_biosppy", write_manifest = TRUE, overwrite = FALSE )
data |
A numeric signal vector or a data frame containing EDA/GSR or PPG/BVP samples. |
signal_type |
Signal type: |
signal_col |
Signal column when |
time_col |
Optional numeric time column expressed in seconds. If absent,
|
group_cols |
Optional participant, session, trial, file, or other grouping columns. |
sampling_rate_hz |
Optional positive sampling frequency in hertz. When
omitted, it is inferred separately for each group from |
missing |
Missing-signal handling: |
irregular |
Handling of irregular sampling intervals: |
sampling_tolerance |
Maximum relative deviation from the expected sample interval before an interval is marked irregular. |
min_segment_samples |
Minimum number of samples retained when
|
signal_units |
Optional descriptive signal unit, such as
|
output_dir |
Optional directory for one-column CSV files and a manifest. |
prefix |
Filename prefix used for exported files. |
write_manifest |
Logical. Write a manifest when |
overwrite |
Logical. Permit replacement of existing output files. |
The function prepares data only. It does not invoke Python or BioSPPy and does not perform physiological interpretation.
BioSPPy signal functions assume a regularly sampled one-dimensional signal and a sampling frequency in hertz. When a time column is supplied, each group must be strictly increasing. Sampling irregularity is assessed against the supplied or inferred sampling rate.
With missing = "interpolate", non-finite signal values are replaced by
linear interpolation within each group. Edge values use the nearest finite
value. At least two finite samples are required.
With missing = "segments", each contiguous finite run is exported as a
separate vector. Runs shorter than min_segment_samples are retained in the
audit table but excluded from the prepared vectors.
Exported signal files contain one numeric value per line without a header, quotation marks, or row names.
An object of class "gazepoint_biosppy_input" containing:
samples: row-level audit table;
vectors: named Python-ready numeric signal vectors;
sampling_rates_hz: sampling frequency for each vector;
manifest: vector-level preparation summary;
files: paths written to disk;
settings: preparation settings and Python call templates.
run_gazepoint_biosppy_eda(),
run_gazepoint_biosppy_ppg()
eda <- data.frame( participant = rep("P01", 4), time_s = c(0, 0.1, 0.2, 0.3), EDA = c(1.0, 1.1, 1.05, 1.2) ) prepared <- prepare_gazepoint_biosppy_input( eda, signal_type = "eda", group_cols = "participant" ) prepared$vectors$P01 prepared$sampling_rates_hzeda <- data.frame( participant = rep("P01", 4), time_s = c(0, 0.1, 0.2, 0.3), EDA = c(1.0, 1.1, 1.05, 1.2) ) prepared <- prepare_gazepoint_biosppy_input( eda, signal_type = "eda", group_cols = "participant" ) prepared$vectors$P01 prepared$sampling_rates_hz
Prepares signal, event, and configuration tables for downstream continuous-time system identification (CTSI) sparse EDA deconvolution workflows. This function does not implement the full Amin-Faghih CTSI solver in R. It creates reproducible input objects and optional CSV files for external CTSI implementations.
prepare_gazepoint_ctsi_input( dat, eda_col = "GSR_US", time_col = "CNT", group_cols = NULL, event_onset_col = NULL, event_name_col = NULL, sampling_rate = NULL, tau0_range = c(2, 4), tau1_range = c(0.5, 1), sparsity_grid = c(0.001, 0.01, 0.1, 1), output_dir = NULL, prefix = "gazepoint_ctsi" )prepare_gazepoint_ctsi_input( dat, eda_col = "GSR_US", time_col = "CNT", group_cols = NULL, event_onset_col = NULL, event_name_col = NULL, sampling_rate = NULL, tau0_range = c(2, 4), tau1_range = c(0.5, 1), sparsity_grid = c(0.001, 0.01, 0.1, 1), output_dir = NULL, prefix = "gazepoint_ctsi" )
dat |
A data frame containing EDA data. |
eda_col |
Numeric EDA/conductance column. |
time_col |
Numeric time column. |
group_cols |
Optional grouping columns, such as participant/session. |
event_onset_col |
Optional event onset column. |
event_name_col |
Optional event/condition column. |
sampling_rate |
Optional sampling rate in Hz. |
tau0_range |
Candidate slow time-constant range. |
tau1_range |
Candidate fast time-constant range. |
sparsity_grid |
Candidate sparsity penalties. |
output_dir |
Optional directory for CSV export. |
prefix |
Output file prefix. |
A list with overview, signal_table, event_table,
ctsi_config, ctsi_notes, written_files, and settings.
Prepares a clean Gazepoint EDA/conductance time-series table that can be exported for external cvxEDA-style workflows. This function does not run a native cvxEDA solver and does not attempt to reproduce cvxEDA internally.
prepare_gazepoint_cvxeda_input( data, eda_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate = NULL, time_unit = c("auto", "ms", "seconds", "samples"), convert_resistance_to_us = FALSE, min_finite_prop = 0.5, output_dir = NULL, prefix = "gazepoint_cvxeda" )prepare_gazepoint_cvxeda_input( data, eda_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate = NULL, time_unit = c("auto", "ms", "seconds", "samples"), convert_resistance_to_us = FALSE, min_finite_prop = 0.5, output_dir = NULL, prefix = "gazepoint_cvxeda" )
data |
A Gazepoint biometric data frame, or a list containing one. |
eda_col |
Optional EDA/conductance column. If omitted, the function
prefers |
time_col |
Optional time/counter column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Optional sampling rate in Hz, used when the time column is a sample counter. |
time_unit |
Unit of |
convert_resistance_to_us |
If |
min_finite_prop |
Minimum finite proportion required for a group to be labelled ready. |
output_dir |
Optional folder where CSV files should be written. |
prefix |
File prefix used when |
A list with overview, signal_table, group_summary, manifest,
and settings.
Converts sample-level Gazepoint gaze and AOI data into a conservative,
audited table compatible with eyetrackingR::make_eyetrackingr_data().
prepare_gazepoint_eyetrackingr_input( data, participant_col = NULL, trial_col = NULL, time_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, rezero_time = FALSE, trackloss_col = NULL, validity_col = NULL, valid_values = NULL, x_col = NULL, y_col = NULL, aoi_col = NULL, aoi_cols = NULL, aoi_levels = NULL, outside_aoi_values = c("", "none", "no_aoi", "outside", "outside_aoi", "non_aoi", "background"), allow_aoi_overlap = FALSE, item_cols = NULL, predictor_cols = NULL, treat_non_aoi_looks_as_missing = TRUE, sampling_tolerance = 0.05, irregular = c("error", "allow"), create_object = FALSE )prepare_gazepoint_eyetrackingr_input( data, participant_col = NULL, trial_col = NULL, time_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, rezero_time = FALSE, trackloss_col = NULL, validity_col = NULL, valid_values = NULL, x_col = NULL, y_col = NULL, aoi_col = NULL, aoi_cols = NULL, aoi_levels = NULL, outside_aoi_values = c("", "none", "no_aoi", "outside", "outside_aoi", "non_aoi", "background"), allow_aoi_overlap = FALSE, item_cols = NULL, predictor_cols = NULL, treat_non_aoi_looks_as_missing = TRUE, sampling_tolerance = 0.05, irregular = c("error", "allow"), create_object = FALSE )
data |
Sample-level Gazepoint data frame. |
participant_col |
Participant identifier column. If |
trial_col |
Trial identifier column. If |
time_col |
Numeric time or sample-counter column. If |
time_unit |
Source time unit: |
sampling_rate_hz |
Sampling rate required when |
rezero_time |
Logical. Subtract the minimum time separately within each participant-trial group. |
trackloss_col |
Optional column where |
validity_col |
Optional gaze-validity column where |
valid_values |
Optional explicit values treated as valid in
|
x_col, y_col
|
Optional gaze-coordinate columns. Missing or non-finite coordinates are treated as track loss. |
aoi_col |
Optional categorical AOI column. |
aoi_cols |
Optional existing binary or logical AOI columns. Supply
either |
aoi_levels |
Optional ordered AOI labels to create from |
outside_aoi_values |
Values in |
allow_aoi_overlap |
Logical. Permit more than one AOI column to be
|
item_cols |
Optional item identifier columns retained in the output and
passed to |
predictor_cols |
Optional condition or predictor columns retained in the compatibility table. |
treat_non_aoi_looks_as_missing |
Logical passed unchanged to
|
sampling_tolerance |
Maximum relative deviation from the median within-trial sampling interval. |
irregular |
Handling of irregular within-trial sampling:
|
create_object |
Logical. If |
The returned compatibility table uses the standardized columns
ParticipantName, Trial, Time_ms, and TrackLoss. Time_ms is expressed in
milliseconds. AOI columns are logical.
Track loss is derived conservatively from the union of an explicit track-loss flag, an invalid validity flag, and missing or non-finite gaze coordinates. A valid look outside every AOI is not silently reclassified as hardware track loss.
eyetrackingR is intended for relatively raw sample-level data in which rows represent equally spaced time samples. Fixation-level or event-level tables should not be supplied to this helper.
An object of class "gazepoint_eyetrackingr_input" containing:
data: plain compatibility data frame;
object: optional output from make_eyetrackingr_data();
row_audit: row-level derivation and ordering audit;
sampling: participant-trial sampling audit;
manifest: column mappings and preparation summary;
settings: resolved preparation settings.
gaze <- data.frame( participant = rep("P01", 4), trial = rep("T01", 4), time_s = c(0, 0.1, 0.2, 0.3), gaze_x = c(0.2, 0.5, 0.8, NA), gaze_y = c(0.5, 0.5, 0.5, NA), AOI = c("left", "center", "right", NA) ) prepared <- prepare_gazepoint_eyetrackingr_input(gaze) prepared$data prepared$samplinggaze <- data.frame( participant = rep("P01", 4), trial = rep("T01", 4), time_s = c(0, 0.1, 0.2, 0.3), gaze_x = c(0.2, 0.5, 0.8, NA), gaze_y = c(0.5, 0.5, 0.5, NA), AOI = c("left", "center", "right", NA) ) prepared <- prepare_gazepoint_eyetrackingr_input(gaze) prepared$data prepared$sampling
Converts long-form sample-level Gazepoint gaze and pupil data into a
conservative, audited table compatible with gazer::make_gazer().
prepare_gazepoint_gazer_input( data, participant_col = NULL, trial_col = NULL, time_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, rezero_time = FALSE, x_col = NULL, y_col = NULL, x_left_col = NULL, y_left_col = NULL, x_right_col = NULL, y_right_col = NULL, pupil_col = NULL, pupil_left_col = NULL, pupil_right_col = NULL, validity_col = NULL, validity_left_col = NULL, validity_right_col = NULL, valid_values = NULL, blink_col = NULL, blink_left_col = NULL, blink_right_col = NULL, invalid_coordinate_values = NULL, invalid_pupil_values = NULL, mask_invalid = FALSE, other_cols = NULL, sampling_tolerance = 0.05, irregular = c("error", "allow"), create_object = FALSE )prepare_gazepoint_gazer_input( data, participant_col = NULL, trial_col = NULL, time_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, rezero_time = FALSE, x_col = NULL, y_col = NULL, x_left_col = NULL, y_left_col = NULL, x_right_col = NULL, y_right_col = NULL, pupil_col = NULL, pupil_left_col = NULL, pupil_right_col = NULL, validity_col = NULL, validity_left_col = NULL, validity_right_col = NULL, valid_values = NULL, blink_col = NULL, blink_left_col = NULL, blink_right_col = NULL, invalid_coordinate_values = NULL, invalid_pupil_values = NULL, mask_invalid = FALSE, other_cols = NULL, sampling_tolerance = 0.05, irregular = c("error", "allow"), create_object = FALSE )
data |
Sample-level Gazepoint data frame. |
participant_col |
Participant identifier column. If |
trial_col |
Trial identifier column. If |
time_col |
Numeric time or sample-counter column. If |
time_unit |
Source time unit: |
sampling_rate_hz |
Sampling rate required when time is represented by sample indices. |
rezero_time |
Logical. Subtract the minimum time separately within each participant-trial group. |
x_col, y_col
|
Optional monocular or already-combined gaze-coordinate columns. |
x_left_col, y_left_col
|
Optional left-eye gaze-coordinate columns. |
x_right_col, y_right_col
|
Optional right-eye gaze-coordinate columns. |
pupil_col |
Optional monocular, cyclopean, or previously combined pupil column. |
pupil_left_col, pupil_right_col
|
Optional left- and right-eye pupil columns. |
validity_col |
Optional shared gaze/pupil validity column. |
validity_left_col, validity_right_col
|
Optional per-eye validity columns. |
valid_values |
Optional explicit values treated as valid. Without this
argument, positive numeric values, |
blink_col |
Optional shared blink column. |
blink_left_col, blink_right_col
|
Optional per-eye blink columns. |
invalid_coordinate_values |
Optional coordinate values to flag explicitly as invalid. Zero is not treated as invalid by default because it can be a valid screen-edge coordinate. |
invalid_pupil_values |
Optional pupil values to flag explicitly as
invalid, for example |
mask_invalid |
Logical. If |
other_cols |
Optional item, condition, block, AOI, stimulus, or other metadata columns retained unchanged. |
sampling_tolerance |
Maximum relative deviation from the median within-trial sampling interval. |
irregular |
Handling of irregular within-trial sampling:
|
create_object |
Logical. If |
The standardized identifier columns are subject, trial, and time.
time is expressed in milliseconds.
Monocular or combined input uses the canonical columns x, y, and
pupil. Binocular input uses x_left, y_left, pupil_left,
x_right, y_right, and pupil_right as available. gazeR retains
multiple selected eye columns when constructing its compatibility table.
The helper does not assign AOIs, calculate track loss, detect or extend blinks, interpolate data, smooth signals, downsample, upsample, baseline-correct pupil size, or run inferential analyses.
An object of class "gazepoint_gazer_input" containing:
data: plain gazeR-compatible long-form data;
object: optional output from make_gazer();
row_audit: row-level availability and invalidity audit;
sampling: participant-trial sampling audit;
manifest: column mappings and preparation summary;
settings: resolved preparation settings.
assign_gazepoint_aoi(),
downsample_gazepoint_data(),
detect_gazepoint_pupil_blinks(),
clean_gazepoint_pupil_signal()
gaze <- data.frame( participant = rep("P01", 4), trial = rep("T01", 4), time_s = c(0, 0.1, 0.2, 0.3), gaze_x = c(0.2, 0.4, 0.6, NA), gaze_y = c(0.5, 0.5, 0.5, NA), pupil_left = c(3.1, 3.2, 3.3, NA), pupil_right = c(3.0, 3.1, 3.2, NA) ) prepared <- prepare_gazepoint_gazer_input(gaze) prepared$data prepared$samplinggaze <- data.frame( participant = rep("P01", 4), trial = rep("T01", 4), time_s = c(0, 0.1, 0.2, 0.3), gaze_x = c(0.2, 0.4, 0.6, NA), gaze_y = c(0.5, 0.5, 0.5, NA), pupil_left = c(3.1, 3.2, 3.3, NA), pupil_right = c(3.0, 3.1, 3.2, NA) ) prepared <- prepare_gazepoint_gazer_input(gaze) prepared$data prepared$sampling
Creates a compact table with time, signal, and optional grouping columns from Gazepoint Biometrics exports. No files are written unless output_dir is supplied.
prepare_gazepoint_heartpy_input( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, output_dir = NULL, prefix = "gazepoint_heartpy" )prepare_gazepoint_heartpy_input( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, output_dir = NULL, prefix = "gazepoint_heartpy" )
data |
Data frame containing Gazepoint biometric samples. |
signal_col |
Pulse/PPG signal column. If NULL, a likely column is inferred. |
time_col |
Time column in seconds. If NULL, a likely column is inferred or created from sampling_rate_hz. |
group_cols |
Optional grouping columns such as participant or trial identifiers. |
sampling_rate_hz |
Sampling rate in Hz. Required if time_col cannot be inferred. |
output_dir |
Optional directory for CSV export. If NULL, no files are written. |
prefix |
File prefix used when output_dir is supplied. |
A list with signal_table, sampling_rate_hz, group_summary, and path.
Prepares a clean Gazepoint EDA/conductance time-series table that can be exported for external Ledalab-style workflows. This function does not run Ledalab and does not attempt to reproduce Ledalab internally.
prepare_gazepoint_ledalab_input( data, eda_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate = NULL, time_unit = c("auto", "ms", "seconds", "samples"), convert_resistance_to_us = FALSE, min_finite_prop = 0.5, output_dir = NULL, prefix = "gazepoint_ledalab" )prepare_gazepoint_ledalab_input( data, eda_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate = NULL, time_unit = c("auto", "ms", "seconds", "samples"), convert_resistance_to_us = FALSE, min_finite_prop = 0.5, output_dir = NULL, prefix = "gazepoint_ledalab" )
data |
A Gazepoint biometric data frame, or a list containing one. |
eda_col |
Optional EDA/conductance column. If omitted, the function
prefers |
time_col |
Optional time/counter column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Optional sampling rate in Hz, used when the time column is a sample counter. |
time_unit |
Unit of |
convert_resistance_to_us |
If |
min_finite_prop |
Minimum finite proportion required for a group to be labelled ready. |
output_dir |
Optional folder where CSV files should be written. |
prefix |
File prefix used when |
A list with overview, signal_table, group_summary, manifest,
and settings.
Lightweight mixed-model preparation helper for Gazepoint-derived trial-level, event-locked, AOI, or physiology summaries. It coerces identifier and condition columns to factors, optionally drops rows with missing outcomes, and adds centered or standardized numeric predictors.
prepare_gazepoint_mixed_model_data( data, outcome_cols = NULL, participant_col = NULL, trial_col = NULL, condition_cols = NULL, factor_cols = NULL, numeric_cols = NULL, center_numeric = TRUE, scale_numeric = FALSE, drop_missing_outcomes = TRUE, ... )prepare_gazepoint_mixed_model_data( data, outcome_cols = NULL, participant_col = NULL, trial_col = NULL, condition_cols = NULL, factor_cols = NULL, numeric_cols = NULL, center_numeric = TRUE, scale_numeric = FALSE, drop_missing_outcomes = TRUE, ... )
data |
Data frame to prepare. |
outcome_cols |
Outcome columns used for optional missing-row removal. |
participant_col |
Optional participant identifier column. |
trial_col |
Optional trial/item identifier column. |
condition_cols |
Optional condition columns. |
factor_cols |
Additional columns to coerce to factors. |
numeric_cols |
Numeric predictors to center or scale. If omitted, all numeric columns except outcomes are considered. |
center_numeric |
If TRUE, add centered numeric columns using suffix
|
scale_numeric |
If TRUE, add standardized numeric columns using suffix
|
drop_missing_outcomes |
If TRUE, remove rows with missing/non-finite
values in |
... |
Reserved for future extensions. |
Data frame of class gazepoint_mixed_model_data.
Creates an integer MNE-style event matrix with columns representing sample number, previous value, and event code. Input may be an event table, numeric event-time vector, or continuous table containing marker columns.
prepare_gazepoint_mne_events( events, event_time_col = NULL, event_label_col = NULL, event_code_col = NULL, marker_cols = NULL, participant_col = NULL, trial_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz, recording_start_s = 0, first_samp = 0L, event_id = NULL, previous_value = 0L, marker_onset = c("change", "nonzero"), duplicate = c("error", "allow"), export_csv = NULL )prepare_gazepoint_mne_events( events, event_time_col = NULL, event_label_col = NULL, event_code_col = NULL, marker_cols = NULL, participant_col = NULL, trial_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz, recording_start_s = 0, first_samp = 0L, event_id = NULL, previous_value = 0L, marker_onset = c("change", "nonzero"), duplicate = c("error", "allow"), export_csv = NULL )
events |
Numeric event-time vector or data frame. |
event_time_col |
Event-time column for event-table input. |
event_label_col |
Optional event-label column. |
event_code_col |
Optional positive integer event-code column. |
marker_cols |
Optional marker or TTL columns in continuous input. |
participant_col |
Optional participant column retained in the audit. |
trial_col |
Optional trial column retained in the audit. |
time_unit |
Time unit: |
sampling_rate_hz |
Positive sampling frequency used to convert event times to MNE sample numbers. |
recording_start_s |
Recording start in seconds in the same clock domain as the converted event times. |
first_samp |
Integer MNE first-sample offset. |
event_id |
Optional named integer event dictionary or data frame with
|
previous_value |
Integer previous-event value placed in the second event-matrix column. |
marker_onset |
Whether marker input creates events only on value changes or for every non-zero row. |
duplicate |
Handling of repeated event sample numbers. |
export_csv |
Optional path for a headerless three-column event file. |
A "gazepoint_mne_events" object containing the event matrix,
event table, event dictionary, audit, and settings.
Produces a channel-by-sample matrix and metadata specifications suitable for
mne.create_info() and mne.io.RawArray(). No Python execution is required.
prepare_gazepoint_mne_input( data, channel_cols = NULL, channel_names = NULL, channel_types = NULL, time_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, first_samp = 0L, scale_factors = NULL, missing = c("error", "allow"), irregular = c("error", "allow"), sampling_tolerance = 0.05 )prepare_gazepoint_mne_input( data, channel_cols = NULL, channel_names = NULL, channel_types = NULL, time_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, first_samp = 0L, scale_factors = NULL, missing = c("error", "allow"), irregular = c("error", "allow"), sampling_tolerance = 0.05 )
data |
One continuous sample-level data frame. |
channel_cols |
Numeric signal columns. If omitted, common Gazepoint gaze, pupil, physiology, marker, and temperature columns are detected. |
channel_names |
Optional MNE channel names. |
channel_types |
Optional MNE channel types, either parallel to
|
time_col |
Numeric time column. |
time_unit |
Time unit. |
sampling_rate_hz |
Optional sampling frequency. If omitted it is inferred from the median interval. |
first_samp |
Integer MNE first-sample offset. |
scale_factors |
Optional explicit numeric factors applied to channels. |
missing |
Handling of non-finite signal values. |
irregular |
Handling of irregular sampling. |
sampling_tolerance |
Maximum relative interval deviation. |
A "gazepoint_mne_input" object.
Creates a model-ready table from Gazepoint biometric window summaries and,
optionally, eye-tracking summaries produced by gp3tools or another
workflow. The function is intentionally conservative: it does not fit a
model, impute missing values, or remove rows automatically.
prepare_gazepoint_multimodal_model_data( biometrics, eye_tracking = NULL, group_columns = NULL, biometric_is_summarised = FALSE, by = NULL, all = FALSE )prepare_gazepoint_multimodal_model_data( biometrics, eye_tracking = NULL, group_columns = NULL, biometric_is_summarised = FALSE, by = NULL, all = FALSE )
biometrics |
A data frame containing row-level Gazepoint Biometrics data or an already summarised biometric window table. |
eye_tracking |
Optional eye-tracking summary table to merge with the biometric summaries. |
group_columns |
Columns defining the analysis unit, such as
|
biometric_is_summarised |
Logical. If |
by |
Optional merge keys. If |
all |
Should a full outer join be used when eye-tracking data are
supplied? Defaults to |
A data frame with class "gazepoint_multimodal_model_data" and a
"model_data_summary" attribute.
Prepares EDA/GSR signal tables for optional external NeuroKit2 processing. This helper does not require Python or NeuroKit2.
prepare_gazepoint_neurokit_eda_input( data, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, sampling_rate = NULL, output_dir = NULL, prefix = "gazepoint_neurokit_eda" )prepare_gazepoint_neurokit_eda_input( data, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, sampling_rate = NULL, output_dir = NULL, prefix = "gazepoint_neurokit_eda" )
data |
A Gazepoint biometric data frame. |
eda_col |
EDA/GSR signal column. |
time_col |
Optional time/counter column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Optional sampling rate in Hz. |
output_dir |
Optional directory where per-group CSV files are written. |
prefix |
File prefix used when |
A list with overview, eda_table, group_summary, manifest,
and settings.
Prepares Gazepoint EDA data and event metadata for downstream PsPM dynamic causal modelling workflows. This function does not run PsPM or invert a DCM model in R. It creates structured input tables and notes for MATLAB/PsPM.
prepare_gazepoint_pspm_dcm_input( dat, eda_col = "GSR_US", time_col = "CNT", event_onset_col = NULL, event_duration_col = NULL, event_name_col = NULL, participant_col = NULL, session_col = NULL, sampling_rate = NULL, output_dir = NULL, prefix = "gazepoint_pspm_dcm" )prepare_gazepoint_pspm_dcm_input( dat, eda_col = "GSR_US", time_col = "CNT", event_onset_col = NULL, event_duration_col = NULL, event_name_col = NULL, participant_col = NULL, session_col = NULL, sampling_rate = NULL, output_dir = NULL, prefix = "gazepoint_pspm_dcm" )
dat |
A data frame containing EDA data. |
eda_col |
Numeric EDA/conductance column. |
time_col |
Numeric time column. |
event_onset_col |
Optional event onset column. |
event_duration_col |
Optional event duration column. |
event_name_col |
Optional event name/condition column. |
participant_col |
Optional participant column. |
session_col |
Optional session column. |
sampling_rate |
Optional sampling rate in Hz. |
output_dir |
Optional directory for CSV export. |
prefix |
File prefix when |
A list with overview, signal_table, event_table,
pspm_notes, written_files, and settings.
Prepares a clean Gazepoint EDA/conductance time-series table that can be exported for external PsPM-style workflows. This function does not run PsPM and does not attempt to reproduce PsPM internally.
prepare_gazepoint_pspm_input( data, eda_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate = NULL, time_unit = c("auto", "ms", "seconds", "samples"), convert_resistance_to_us = FALSE, min_finite_prop = 0.5, output_dir = NULL, prefix = "gazepoint_pspm" )prepare_gazepoint_pspm_input( data, eda_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate = NULL, time_unit = c("auto", "ms", "seconds", "samples"), convert_resistance_to_us = FALSE, min_finite_prop = 0.5, output_dir = NULL, prefix = "gazepoint_pspm" )
data |
A Gazepoint biometric data frame, or a list containing one. |
eda_col |
Optional EDA/conductance column. If omitted, the function
prefers |
time_col |
Optional time/counter column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Optional sampling rate in Hz, used when the time column is a sample counter. |
time_unit |
Unit of |
convert_resistance_to_us |
If |
min_finite_prop |
Minimum finite proportion required for a group to be labelled ready. |
output_dir |
Optional folder where CSV files should be written. |
prefix |
File prefix used when |
A list with overview, signal_table, group_summary, manifest,
and settings.
Converts sample-level Gazepoint pupil data into a conservative, audited
long-form table compatible with
PupillometryR::make_pupillometryr_data().
prepare_gazepoint_pupillometryr_input( data, participant_col = NULL, trial_col = NULL, time_col = NULL, condition_col = NULL, pupil_left_col = NULL, pupil_right_col = NULL, pupil_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, rezero_time = FALSE, invalid_pupil_values = NULL, validity_cols = NULL, valid_values = NULL, blink_cols = NULL, mask_invalid = FALSE, create_mean_pupil = TRUE, other_cols = NULL, sampling_tolerance = 0.05, irregular = c("error", "allow"), create_object = FALSE )prepare_gazepoint_pupillometryr_input( data, participant_col = NULL, trial_col = NULL, time_col = NULL, condition_col = NULL, pupil_left_col = NULL, pupil_right_col = NULL, pupil_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, rezero_time = FALSE, invalid_pupil_values = NULL, validity_cols = NULL, valid_values = NULL, blink_cols = NULL, mask_invalid = FALSE, create_mean_pupil = TRUE, other_cols = NULL, sampling_tolerance = 0.05, irregular = c("error", "allow"), create_object = FALSE )
data |
Sample-level Gazepoint pupil data frame. |
participant_col |
Participant identifier column. If |
trial_col |
Trial identifier column. If |
time_col |
Numeric time or sample-counter column. If |
condition_col |
Experimental-condition column. If |
pupil_left_col |
Optional left-pupil column. |
pupil_right_col |
Optional right-pupil column. |
pupil_col |
Optional single, cyclopean, or previously averaged pupil
column. Supply either |
time_unit |
Source time unit: |
sampling_rate_hz |
Sampling rate required when time is represented by sample indices. |
rezero_time |
Logical. Subtract the first time separately within each participant-trial group. |
invalid_pupil_values |
Optional pupil values to flag explicitly as
invalid, for example |
validity_cols |
Optional pupil-validity columns. Supply one column to apply it to all pupil channels or one column per pupil channel. |
valid_values |
Optional explicit values treated as valid in
|
blink_cols |
Optional blink columns. Supply one column to apply it to all pupil channels or one column per pupil channel. |
mask_invalid |
Logical. When |
create_mean_pupil |
Logical. Create |
other_cols |
Optional additional condition, item, stimulus, block, or metadata columns retained unchanged. |
sampling_tolerance |
Maximum relative deviation from the median within-trial sampling interval. |
irregular |
Handling of irregular sampling: |
create_object |
Logical. If |
The standardized compatibility columns are Subject, Trial, Time, and
Condition. Time is expressed in milliseconds. Pupil columns are named
Pupil_Left, Pupil_Right, Pupil, and, when requested and available,
Pupil_Mean.
The helper does not detect blinks, interpolate gaps, filter pupil signals,
remove trials, baseline-correct pupil size, or run inferential analyses.
Existing blink and validity columns are preserved as audit information and
are used for masking only when mask_invalid = TRUE.
An object of class "gazepoint_pupillometryr_input" containing:
data: plain PupillometryR-compatible long-form data;
object: optional PupillometryR object;
row_audit: row-level pupil availability and flag audit;
sampling: participant-trial sampling audit;
manifest: column mappings and preparation summary;
settings: resolved preparation settings.
detect_gazepoint_pupil_blinks(),
clean_gazepoint_pupil_signal(),
baseline_correct_gazepoint_pupil()
pupil <- data.frame( participant = rep("P01", 4), trial = rep("T01", 4), condition = rep("target", 4), time_s = c(0, 0.1, 0.2, 0.3), pupil_left = c(3.1, 3.2, NA, 3.3), pupil_right = c(3.0, 3.1, NA, 3.2) ) prepared <- prepare_gazepoint_pupillometryr_input(pupil) prepared$data prepared$samplingpupil <- data.frame( participant = rep("P01", 4), trial = rep("T01", 4), condition = rep("target", 4), time_s = c(0, 0.1, 0.2, 0.3), pupil_left = c(3.1, 3.2, NA, 3.3), pupil_right = c(3.0, 3.1, NA, 3.2) ) prepared <- prepare_gazepoint_pupillometryr_input(pupil) prepared$data prepared$sampling
Converts Gazepoint inter-beat or RR intervals into millisecond NN-interval vectors suitable for transfer to Python pyHRV workflows. The function does not invoke Python or pyHRV.
prepare_gazepoint_pyhrv_input( data, ibi_col = NULL, group_cols = NULL, unit = c("auto", "milliseconds", "seconds"), filter = c("none", "plausible"), min_nni_ms = 300, max_nni_ms = 2000, collapse_repeated_intervals = FALSE, repeated_tolerance_ms = 1e-08, output_dir = NULL, prefix = "gazepoint_pyhrv", write_manifest = TRUE, overwrite = FALSE )prepare_gazepoint_pyhrv_input( data, ibi_col = NULL, group_cols = NULL, unit = c("auto", "milliseconds", "seconds"), filter = c("none", "plausible"), min_nni_ms = 300, max_nni_ms = 2000, collapse_repeated_intervals = FALSE, repeated_tolerance_ms = 1e-08, output_dir = NULL, prefix = "gazepoint_pyhrv", write_manifest = TRUE, overwrite = FALSE )
data |
A numeric interval vector or a data frame containing an IBI, RR, or NN-interval column. |
ibi_col |
Interval column when |
group_cols |
Optional participant, session, trial, or file columns. One pyHRV-ready vector is produced per group. |
unit |
Input interval unit: |
filter |
Which intervals should be included in the pyHRV vectors:
|
min_nni_ms |
Minimum plausible NN interval in milliseconds. |
max_nni_ms |
Maximum plausible NN interval in milliseconds. |
collapse_repeated_intervals |
Logical. If |
repeated_tolerance_ms |
Non-negative tolerance used to identify consecutive repeated intervals. |
output_dir |
Optional directory in which one-column CSV files and a manifest are written. |
prefix |
Filename prefix used when |
write_manifest |
Logical. If |
overwrite |
Logical. If |
Input rows are retained in an auditable interval table. Missing, non-positive, implausible, and repeated intervals are flagged explicitly rather than removed silently.
Automatic unit assessment first examines the interval-column name. Names containing common millisecond markers are interpreted as milliseconds. Otherwise, the median positive interval is used: values no greater than 10 are interpreted as seconds, and values at least 100 as milliseconds. Intermediate values are considered ambiguous and require an explicit unit.
CSV interval files contain one numeric millisecond value per line, without row names, quotation marks, or a header. They can therefore be read into Python as a one-dimensional numeric vector.
Repeated-interval collapsing is optional because physiologically genuine adjacent intervals may occasionally have identical values. The setting should be chosen according to the structure of the source export.
An object of class "gazepoint_pyhrv_input" containing:
intervals: auditable row-level interval table;
vectors: named list of pyHRV-ready numeric millisecond vectors;
manifest: group-level interval and exclusion summary;
files: paths written when output_dir is supplied;
settings: complete preparation settings.
run_gazepoint_pyhrv_style(),
check_gazepoint_pyhrv_interval(),
prepare_gazepoint_rhrv_input()
ibi <- data.frame( participant = c("P01", "P01", "P01"), IBI_clean_ms = c(800, 810, 790) ) prepared <- prepare_gazepoint_pyhrv_input( ibi, group_cols = "participant" ) prepared$vectors$P01 prepared$manifestibi <- data.frame( participant = c("P01", "P01", "P01"), IBI_clean_ms = c(800, 810, 790) ) prepared <- prepare_gazepoint_pyhrv_input( ibi, group_cols = "participant" ) prepared$vectors$P01 prepared$manifest
Prepares a Gazepoint heart-rate pulse waveform column, usually HRP, as a
lightweight input table for optional pyPPG workflows. This helper does not
call Python, does not require pyPPG, and does not derive HRV features. It only
prepares waveform values, timing information when available, and conservative
group-level summaries for interoperability review.
prepare_gazepoint_pyppg_input( data, ppg_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate = NULL, time_unit = c("auto", "ms", "seconds", "samples"), min_finite_prop = 0.5, output_dir = NULL, prefix = "gazepoint_pyppg" )prepare_gazepoint_pyppg_input( data, ppg_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate = NULL, time_unit = c("auto", "ms", "seconds", "samples"), min_finite_prop = 0.5, output_dir = NULL, prefix = "gazepoint_pyppg" )
data |
A Gazepoint biometric data frame or a list containing one. |
ppg_col |
Optional HRP/PPG waveform column. If |
time_col |
Optional time, timestamp, or sample-counter column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Optional sampling rate in Hz. Useful when |
time_unit |
Unit of |
min_finite_prop |
Minimum finite waveform proportion used for group readiness summaries. |
output_dir |
Optional directory for CSV export. If |
prefix |
File prefix used when |
A list with overview, waveform_table, group_summary,
manifest, and settings.
Backward-compatible alias for export_gazepoint_rhrv_input(). This helper
prepares analysis-ready inter-beat interval input for optional RHRV workflows.
It does not call RHRV and does not derive HRV from Gazepoint's raw HRV
field. HRV features should be derived from genuine IBI/RR intervals.
prepare_gazepoint_rhrv_input( data, ibi_col = "IBI_clean_ms", group_cols = NULL, unit = c("auto", "ms", "seconds"), collapse_repeated_intervals = TRUE, repeated_tolerance_ms = 1e-08, min_ibi_ms = 300, max_ibi_ms = 2000, output_dir = NULL, prefix = "gazepoint_rhrv" )prepare_gazepoint_rhrv_input( data, ibi_col = "IBI_clean_ms", group_cols = NULL, unit = c("auto", "ms", "seconds"), collapse_repeated_intervals = TRUE, repeated_tolerance_ms = 1e-08, min_ibi_ms = 300, max_ibi_ms = 2000, output_dir = NULL, prefix = "gazepoint_rhrv" )
data |
A Gazepoint biometric data frame or |
ibi_col |
IBI/RR interval column. |
group_cols |
Optional grouping columns. |
unit |
Unit of the IBI column: |
collapse_repeated_intervals |
Logical. If |
repeated_tolerance_ms |
Numeric tolerance used when identifying repeated consecutive IBI values. |
min_ibi_ms |
Minimum plausible IBI in milliseconds retained for export. |
max_ibi_ms |
Maximum plausible IBI in milliseconds retained for export. |
output_dir |
Optional directory where per-group CSV files are written. |
prefix |
File prefix used when |
A list returned by export_gazepoint_rhrv_input().
Converts SCR event-window summaries into model-ready data for two-part electrodermal-response analyses: a binary response/no-response component and a positive-amplitude component among response events.
prepare_gazepoint_scr_hurdle_model_data( scr_event_windows, response_col = "response_flag", amplitude_col = "scr_amplitude", latency_col = "scr_latency", rise_time_col = "scr_rise_time", recovery_time_col = "scr_recovery_time", predictor_cols = NULL, factor_cols = NULL, numeric_cols = NULL, group_cols = NULL, event_id_col = "event_id", amplitude_transform = c("none", "log", "log1p"), amplitude_offset = 1e-06, drop_missing_predictors = TRUE )prepare_gazepoint_scr_hurdle_model_data( scr_event_windows, response_col = "response_flag", amplitude_col = "scr_amplitude", latency_col = "scr_latency", rise_time_col = "scr_rise_time", recovery_time_col = "scr_recovery_time", predictor_cols = NULL, factor_cols = NULL, numeric_cols = NULL, group_cols = NULL, event_id_col = "event_id", amplitude_transform = c("none", "log", "log1p"), amplitude_offset = 1e-06, drop_missing_predictors = TRUE )
scr_event_windows |
A |
response_col |
Column containing the binary SCR response flag. |
amplitude_col |
Column containing SCR amplitude. |
latency_col |
Optional column containing SCR latency. |
rise_time_col |
Optional column containing SCR rise time. |
recovery_time_col |
Optional column containing SCR recovery time. |
predictor_cols |
Optional fixed-effect predictor columns to include in generated formulas and complete-case checks. |
factor_cols |
Optional columns to coerce to factors. |
numeric_cols |
Optional columns to coerce to numeric. |
group_cols |
Optional grouping columns retained for random effects or clustered summaries. |
event_id_col |
Optional event identifier column. |
amplitude_transform |
Transformation for the positive-amplitude outcome:
|
amplitude_offset |
Small positive offset used when
|
drop_missing_predictors |
Logical. If |
A list with overview, response_model_data,
amplitude_model_data, variable_summary, model_formulas, and
settings.
Prepares a participant-level, condition-level time-course data set for a conservative two-condition cluster-based permutation prototype. The helper aggregates repeated observations to one value per participant, condition, and time bin, then checks that the resulting data form a complete within-subject time grid.
prepare_gazepoint_timecourse_test_data( data, outcome_col, time_col, condition_col, participant_col, condition_a = NULL, condition_b = NULL, time_bin_width = NULL, aggregation = c("mean", "median"), require_complete = TRUE )prepare_gazepoint_timecourse_test_data( data, outcome_col, time_col, condition_col, participant_col, condition_a = NULL, condition_b = NULL, time_bin_width = NULL, aggregation = c("mean", "median"), require_complete = TRUE )
data |
A data frame. |
outcome_col |
Name of the numeric outcome column. |
time_col |
Name of the numeric time column. |
condition_col |
Name of the condition column. |
participant_col |
Name of the participant identifier column. |
condition_a |
Optional first condition level. |
condition_b |
Optional second condition level. |
time_bin_width |
Optional numeric time-bin width. If supplied, time is
binned using |
aggregation |
Aggregation rule for repeated rows within participant,
condition, and time. Currently |
require_complete |
Logical. If |
This function is intended for exploratory time-course inference on already preprocessed Gazepoint-derived signals. It does not perform blink correction, artefact correction, baseline correction, filtering, or physiological interpretation.
A data frame with columns participant, condition, time, and
value, with class gazepoint_timecourse_test_data.
Runs a conservative, beginner-friendly preprocessing sequence over a Gazepoint data frame or imported session list. Available channels are detected heuristically. Missing numeric signal gaps can be imputed, pupil blinks cleaned, and gaze samples filtered when the relevant functions and columns are available.
preprocess_gazepoint_all( data, impute_missing = TRUE, clean_pupil = TRUE, filter_gaze = TRUE, max_gap = 10, screen_bounds = c(0, 1, 0, 1), max_velocity = Inf, verbose = TRUE )preprocess_gazepoint_all( data, impute_missing = TRUE, clean_pupil = TRUE, filter_gaze = TRUE, max_gap = 10, screen_bounds = c(0, 1, 0, 1), max_velocity = Inf, verbose = TRUE )
data |
Data frame or list of data frames. |
impute_missing |
If TRUE, impute short missing gaps in numeric columns. |
clean_pupil |
If TRUE, clean detected pupil columns. |
filter_gaze |
If TRUE, filter detected gaze coordinates. |
max_gap |
Maximum gap length in samples for imputation. |
screen_bounds |
Screen bounds for gaze filtering. |
max_velocity |
Maximum gaze velocity for gaze filtering. |
verbose |
If TRUE, print a compact preprocessing log. |
A preprocessed object of the same basic structure as data, with a
preprocessing_log attribute.
dat <- data.frame(time_s = 1:5, GSR = c(1, NA, 3, 4, 5)) preprocess_gazepoint_all(dat)dat <- data.frame(time_s = 1:5, GSR = c(1, NA, 3, 4, 5)) preprocess_gazepoint_all(dat)
Preprocess Gazepoint SCR/GSR data PsPM-style
preprocess_gazepoint_scr_pspm_style( data, signal_col = NULL, time_col = NULL, sampling_rate_hz = NULL, range = c(0, 50), slope_limit_per_s = 10, clipping_tolerance = 1e-05, clipping_seconds = 0.5, min_valid_island_seconds = 1, artifact_epoch_seconds = 0.25, smoothing_seconds = 0.25 )preprocess_gazepoint_scr_pspm_style( data, signal_col = NULL, time_col = NULL, sampling_rate_hz = NULL, range = c(0, 50), slope_limit_per_s = 10, clipping_tolerance = 1e-05, clipping_seconds = 0.5, min_valid_island_seconds = 1, artifact_epoch_seconds = 0.25, smoothing_seconds = 0.25 )
data |
Gazepoint data frame or numeric SCR/GSR signal. |
signal_col |
SCR/GSR column. |
time_col |
Time column. |
sampling_rate_hz |
Sampling rate for numeric input or missing time. |
range |
Valid signal range. |
slope_limit_per_s |
Maximum absolute slope per second. |
clipping_tolerance |
Difference threshold for flat clipping detection. |
clipping_seconds |
Minimum flat-run duration. |
min_valid_island_seconds |
Minimum valid island length. |
artifact_epoch_seconds |
Seconds to expand around detected artefacts. |
smoothing_seconds |
Smoothing window after artefact correction. |
List with processed signal, artifact table, summary, and settings.
Run a full HeartPy-style Gazepoint pulse/PPG process
process_gazepoint_ppg_heartpy_style( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, clean_rr = TRUE, clean_rr_method = c("quotient", "iqr", "modified_z", "zscore", "none"), frequency_method = c("welch", "fft", "periodogram"), output_dir = NULL, ... )process_gazepoint_ppg_heartpy_style( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, clean_rr = TRUE, clean_rr_method = c("quotient", "iqr", "modified_z", "zscore", "none"), frequency_method = c("welch", "fft", "periodogram"), output_dir = NULL, ... )
data |
Data frame or numeric pulse/PPG signal. |
signal_col |
Signal column when data is a data frame. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
sampling_rate_hz |
Sampling rate in Hz. |
clean_rr |
Whether to clean RR intervals after peak rejection. |
clean_rr_method |
RR cleaning method. |
frequency_method |
Frequency-domain method. |
output_dir |
Optional output directory. If NULL, no files are written. |
... |
Additional arguments passed to detect_gazepoint_ppg_peaks(). |
A list with detection, peaks, measures, frequency, quality, report, and settings.
Process Gazepoint pulse/PPG data in overlapping HeartPy-style segments
process_gazepoint_ppg_segmentwise( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, window_seconds = 60, overlap = 0.5, min_segment_seconds = 10, clean_rr = TRUE, clean_rr_method = c("quotient", "iqr", "modified_z", "zscore", "none"), frequency_method = c("welch", "fft", "periodogram"), ... )process_gazepoint_ppg_segmentwise( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, window_seconds = 60, overlap = 0.5, min_segment_seconds = 10, clean_rr = TRUE, clean_rr_method = c("quotient", "iqr", "modified_z", "zscore", "none"), frequency_method = c("welch", "fft", "periodogram"), ... )
data |
Data frame or numeric pulse/PPG signal. |
signal_col |
Signal column when data is a data frame. |
time_col |
Time column. |
group_cols |
Optional grouping columns. |
sampling_rate_hz |
Sampling rate in Hz. |
window_seconds |
Segment length. |
overlap |
Segment overlap proportion. |
min_segment_seconds |
Minimum segment duration to process. |
clean_rr |
Whether to clean RR intervals. |
clean_rr_method |
RR cleaning method. |
frequency_method |
Frequency-domain method. |
... |
Additional arguments passed to detect_gazepoint_ppg_peaks(). |
A list with segment table, peaks, measures, frequency, and settings.
Create a compact, auditable profile of a Gazepoint-style export folder before running a full workflow. The profiler inspects files, row and column counts, likely Gazepoint column roles, missingness, numeric signal activity, constant columns, all-zero columns, and read errors.
profile_gazepoint_export_folder( path, pattern = "\\.csv$", recursive = FALSE, max_files = Inf, max_rows = Inf, na.strings = c("", "NA", "NaN") )profile_gazepoint_export_folder( path, pattern = "\\.csv$", recursive = FALSE, max_files = Inf, max_rows = Inf, na.strings = c("", "NA", "NaN") )
path |
Path to a folder containing Gazepoint-style export files. |
pattern |
File-name regular expression. Defaults to CSV files. |
recursive |
Logical. If |
max_files |
Maximum number of matching files to inspect. |
max_rows |
Maximum number of rows to read per file for profiling.
Use |
na.strings |
Character vector of strings to treat as missing values. |
A list with class "gazepoint_export_folder_profile" containing
overview, files, columns, warnings, and settings tables.
demo_dir <- system.file( "extdata", "gazepoint_biometrics_kiosk_demo_exports", package = "gpbiometrics" ) if (nzchar(demo_dir)) { profile <- profile_gazepoint_export_folder(demo_dir, max_files = 2) profile }demo_dir <- system.file( "extdata", "gazepoint_biometrics_kiosk_demo_exports", package = "gpbiometrics" ) if (nzchar(demo_dir)) { profile <- profile_gazepoint_export_folder(demo_dir, max_files = 2) profile }
Creates window-level and participant-level exclusion recommendations from Gazepoint biometric usable-sample summaries. The function does not remove data. It only creates transparent keep, review, or exclude recommendations.
recommend_gazepoint_biometric_exclusions( data, group_columns = NULL, data_is_window_summary = FALSE, participant_column = NULL, gsr_min_usable_pct = 50, hr_min_usable_pct = 50, dial_min_usable_pct = 50, require_gsr = TRUE, require_hr = TRUE, require_dial = FALSE )recommend_gazepoint_biometric_exclusions( data, group_columns = NULL, data_is_window_summary = FALSE, participant_column = NULL, gsr_min_usable_pct = 50, hr_min_usable_pct = 50, dial_min_usable_pct = 50, require_gsr = TRUE, require_hr = TRUE, require_dial = FALSE )
data |
A row-level Gazepoint Biometrics data frame, a path to a Gazepoint CSV export, or an already summarised multimodal window table. |
group_columns |
Columns defining analysis windows when |
data_is_window_summary |
Logical. If |
participant_column |
Optional participant identifier column. If |
gsr_min_usable_pct |
Minimum acceptable usable percentage for GSR/EDA. |
hr_min_usable_pct |
Minimum acceptable usable percentage for heart rate. |
dial_min_usable_pct |
Minimum acceptable usable percentage for engagement dial. |
require_gsr |
Should low GSR/EDA coverage cause exclusion rather than review? |
require_hr |
Should low heart-rate coverage cause exclusion rather than review? |
require_dial |
Should low engagement-dial coverage cause exclusion rather than review? |
A list with overview, window_recommendations,
participant_recommendations, and settings.
Detect and reconstruct clipped pulse/PPG samples
reconstruct_gazepoint_ppg_clipping( x, near_max_prop = 0.02, flat_diff_prop = 0.001, min_run = 2L )reconstruct_gazepoint_ppg_clipping( x, near_max_prop = 0.02, flat_diff_prop = 0.001, min_run = 2L )
x |
Numeric pulse/PPG signal. |
near_max_prop |
Proportion of the observed range used to define near-maximum samples. |
flat_diff_prop |
Proportion of the observed range used to define near-flat differences. |
min_run |
Minimum number of consecutive clipped samples. |
A list with signal, clipped, and runs.
Regresses continuous pupil diameter on frame-wise or sample-wise stimulus luminance and returns a luminance-adjusted pupil series. This controls a major visual confound but does not prove that residual pupil changes are cognitive-load-only effects.
regress_gazepoint_pupil_luminance( dat, pupil_col, luminance_col, group_cols = NULL, time_col = NULL, output_col = "pupil_luminance_adjusted", fitted_col = "pupil_luminance_fitted", include_quadratic = TRUE, model_by_group = TRUE, add_intercept_mean = TRUE )regress_gazepoint_pupil_luminance( dat, pupil_col, luminance_col, group_cols = NULL, time_col = NULL, output_col = "pupil_luminance_adjusted", fitted_col = "pupil_luminance_fitted", include_quadratic = TRUE, model_by_group = TRUE, add_intercept_mean = TRUE )
dat |
A data frame. |
pupil_col |
Numeric pupil column. |
luminance_col |
Numeric luminance/brightness column. |
group_cols |
Optional grouping columns. |
time_col |
Optional time column. |
output_col |
Output luminance-adjusted pupil column. |
fitted_col |
Output fitted luminance component column. |
include_quadratic |
Logical. If |
model_by_group |
Logical. If |
add_intercept_mean |
Logical. If |
A data frame with luminance-adjusted pupil columns and attributes.
Reject implausible pulse/PPG peaks using RR-interval thresholds
reject_gazepoint_ppg_peaks( peaks, group_col = "group", rr_tolerance = 0.3, min_rr_ms = 300 )reject_gazepoint_ppg_peaks( peaks, group_col = "group", rr_tolerance = 0.3, min_rr_ms = 300 )
peaks |
Peak table returned by detect_gazepoint_ppg_peaks(). |
group_col |
Group column. |
rr_tolerance |
Proportional RR tolerance around the group mean. |
min_rr_ms |
Minimum absolute tolerance in milliseconds. |
Peak table with accepted and rr_ms columns.
Remove baseline wander from Gazepoint pulse/PPG data
remove_gazepoint_ppg_baseline_wander( x, sampling_rate_hz, method = c("median", "mean"), window_seconds = 2 )remove_gazepoint_ppg_baseline_wander( x, sampling_rate_hz, method = c("median", "mean"), window_seconds = 2 )
x |
Numeric signal. |
sampling_rate_hz |
Sampling rate in Hz. |
method |
Baseline method: median or mean. |
window_seconds |
Baseline window length. |
Baseline-corrected numeric signal.
Generates cautious manuscript-ready wording for a cluster-permutation result. The wording avoids precise onset or offset claims and frames cluster timing as descriptive.
report_gazepoint_cluster_permutation( result, cluster_alpha = 0.05, digits = 3L, include_assumptions = TRUE )report_gazepoint_cluster_permutation( result, cluster_alpha = 0.05, digits = 3L, include_assumptions = TRUE )
result |
Object returned by |
cluster_alpha |
Cluster-level alpha used to classify clusters. |
digits |
Number of digits used for p-values. |
include_assumptions |
Should an assumptions note be included? |
An object of class gazepoint_cluster_report.
Generates dependency-free data-quality report files for Gazepoint data. The report summarizes missingness, numeric distributions, robust outlier counts, and simple QC plots. HTML and PDF outputs are created using base R only.
report_gazepoint_data_quality( data, output_dir = tempfile("gazepoint_quality_report_"), report_name = "gazepoint_data_quality", formats = c("html", "csv"), max_plot_columns = 6, open = FALSE )report_gazepoint_data_quality( data, output_dir = tempfile("gazepoint_quality_report_"), report_name = "gazepoint_data_quality", formats = c("html", "csv"), max_plot_columns = 6, open = FALSE )
data |
Data frame or list of data frames. |
output_dir |
Output directory. |
report_name |
File prefix for report outputs. |
formats |
Character vector containing |
max_plot_columns |
Maximum number of numeric columns plotted per table. |
open |
If TRUE, open the HTML report interactively. |
Invisibly returns a list with output paths and summary tables.
## Not run: report_gazepoint_data_quality(data.frame(time_s = 1:5, GSR = rnorm(5))) ## End(Not run)## Not run: report_gazepoint_data_quality(data.frame(time_s = 1:5, GSR = rnorm(5))) ## End(Not run)
Compatibility alias for estimate_gazepoint_respiration_from_ppg(). The
returned value should be interpreted as an exploratory PPG-derived
respiration-rate estimate, not as a direct respiratory measurement.
respiration_from_ppg(data, ...)respiration_from_ppg(data, ...)
data |
Data frame or numeric PPG vector. |
... |
Additional arguments passed to
|
Output from estimate_gazepoint_respiration_from_ppg().
Runs simple exploratory group comparisons for numeric feature columns. The function selects one-way ANOVA when all groups pass Shapiro-Wilk checks and Kruskal-Wallis otherwise. It also performs pairwise post-hoc tests with multiplicity correction.
run_gazepoint_automated_statistics( dat, outcome_cols, group_col, alpha = 0.05, p_adjust_method = "holm", normality_alpha = 0.05, min_group_n = 3 )run_gazepoint_automated_statistics( dat, outcome_cols, group_col, alpha = 0.05, p_adjust_method = "holm", normality_alpha = 0.05, min_group_n = 3 )
dat |
A data frame. |
outcome_cols |
Numeric outcome columns. |
group_col |
Grouping/condition column. |
alpha |
Significance level. |
p_adjust_method |
P-value adjustment method. |
normality_alpha |
Alpha used for Shapiro-Wilk normality screening. |
min_group_n |
Minimum observations per group. |
This is an exploratory reporting helper. It is not a substitute for a preregistered statistical model or expert review of study design.
A list with overview, test_table, posthoc_table,
normality_table, and settings.
Provides conservative pass/warn/fail checks before using real Gazepoint Biometrics exports for analysis or reporting. The function checks basic row count, signal availability, missingness, time ordering, TTL availability, and HRV/IBI caution status. It does not certify data quality or infer emotional states.
run_gazepoint_biometrics_real_data_readiness( data = NULL, workflow_result = NULL, min_rows = 100, min_active_signal_count = 1, max_missing_prop = 0.5, required_signal_cols = NULL, require_gsr_us_preferred = TRUE, require_ibi_for_hrv = FALSE, time_col = NULL, ttl_cols = NULL )run_gazepoint_biometrics_real_data_readiness( data = NULL, workflow_result = NULL, min_rows = 100, min_active_signal_count = 1, max_missing_prop = 0.5, required_signal_cols = NULL, require_gsr_us_preferred = TRUE, require_ibi_for_hrv = FALSE, time_col = NULL, ttl_cols = NULL )
data |
A biometric data frame. If |
workflow_result |
Optional workflow/list object containing biometric data. |
min_rows |
Minimum number of rows expected for a usable real-data check. |
min_active_signal_count |
Minimum number of biometric signal columns with at least one non-missing/non-zero value. |
max_missing_prop |
Maximum acceptable missing proportion for detected signal columns before a warning is raised. |
required_signal_cols |
Optional signal columns that must be present. |
require_gsr_us_preferred |
Logical. If |
require_ibi_for_hrv |
Logical. If |
time_col |
Optional time column. If |
ttl_cols |
Optional TTL marker columns. If |
A list with overview, checks, signal_summary, and settings.
Runs a compact end-to-end workflow for Gazepoint Biometrics exports. The workflow imports rectangular all-gaze/fixation-style CSV exports from a folder, validates biometric columns, detects active channels, audits missingness, signal quality, sampling/timing, optionally creates window-level summaries, creates optional biometric exclusion recommendations, extracts optional TTL marker events, and produces checklist and methods-text outputs.
run_gazepoint_biometrics_workflow( path, group_columns = NULL, recursive = FALSE, include_fixations = FALSE, include_all_gaze = TRUE, include_other_csv = FALSE, require_active_signal = TRUE, create_exclusion_recommendations = TRUE, gsr_min_usable_pct = 50, hr_min_usable_pct = 50, dial_min_usable_pct = 50, extract_ttl_events = TRUE, ttl_event_mode = c("changes", "nonzero"), audit_sampling = TRUE, sampling_group_columns = NULL, sampling_time_column = NULL, sampling_time_unit = c("samples", "seconds", "milliseconds", "microseconds"), expected_sampling_rate_hz = 60 )run_gazepoint_biometrics_workflow( path, group_columns = NULL, recursive = FALSE, include_fixations = FALSE, include_all_gaze = TRUE, include_other_csv = FALSE, require_active_signal = TRUE, create_exclusion_recommendations = TRUE, gsr_min_usable_pct = 50, hr_min_usable_pct = 50, dial_min_usable_pct = 50, extract_ttl_events = TRUE, ttl_event_mode = c("changes", "nonzero"), audit_sampling = TRUE, sampling_group_columns = NULL, sampling_time_column = NULL, sampling_time_unit = c("samples", "seconds", "milliseconds", "microseconds"), expected_sampling_rate_hz = 60 )
path |
Folder containing Gazepoint CSV exports. |
group_columns |
Optional columns used to create multimodal window
summaries, such as |
recursive |
Should subfolders be searched? |
include_fixations |
Should fixation files be imported? Defaults to
|
include_all_gaze |
Should all-gaze files be imported? |
include_other_csv |
Should other non-Data-Summary CSV files be attempted? |
require_active_signal |
Logical. Should inactive biometric signals be flagged in validation/checklist outputs? |
create_exclusion_recommendations |
Logical. Should window-level and
participant-level keep/review/exclude recommendations be created when
|
gsr_min_usable_pct |
Minimum acceptable usable percentage for GSR/EDA windows. |
hr_min_usable_pct |
Minimum acceptable usable percentage for heart-rate windows. |
dial_min_usable_pct |
Minimum acceptable usable percentage for engagement-dial windows. |
extract_ttl_events |
Logical. Should TTL marker events be extracted? |
ttl_event_mode |
TTL event extraction mode passed to
|
audit_sampling |
Logical. Should sampling/timing information be audited? |
sampling_group_columns |
Optional columns for the sampling audit. If
|
sampling_time_column |
Optional time/order column for the sampling audit. |
sampling_time_unit |
Unit of the selected time/order column. Use
|
expected_sampling_rate_hz |
Optional expected sampling rate in Hz. |
A list with imported data, validation outputs, missingness summaries,
quality audits, sampling/timing audits, optional window summaries, optional
exclusion recommendations, optional TTL events, checklist, and methods
text. The object has class "gazepoint_biometrics_workflow".
Run BioSPPy-style Gazepoint EDA processing
run_gazepoint_biosppy_eda( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, smoothing_seconds = 4 )run_gazepoint_biosppy_eda( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, smoothing_seconds = 4 )
data |
Data frame or numeric EDA/GSR signal. |
signal_col |
EDA/GSR column. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
sampling_rate_hz |
Sampling rate in Hz. |
smoothing_seconds |
Window used for tonic smoothing. |
List with raw table, tonic, phasic, events, and recovery estimates.
Run BioSPPy-style Gazepoint PPG/BVP processing
run_gazepoint_biosppy_ppg( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL )run_gazepoint_biosppy_ppg( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL )
data |
Data frame or numeric PPG/BVP signal. |
signal_col |
PPG/BVP column. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
sampling_rate_hz |
Sampling rate in Hz. |
List with filtered signal, peaks, onsets, templates, and heart rate.
Runs a narrow within-subject, two-condition, one-dimensional cluster-based permutation test on participant-level Gazepoint-derived time courses.
run_gazepoint_cluster_permutation( data, outcome_col = "value", time_col = "time", condition_col = "condition", participant_col = "participant", design = "within", condition_a = NULL, condition_b = NULL, n_permutations = 1000, cluster_forming_alpha = 0.05, cluster_alpha = 0.05, tail = c("two.sided", "positive", "negative"), seed = NULL, time_bin_width = NULL, aggregation = c("mean", "median") )run_gazepoint_cluster_permutation( data, outcome_col = "value", time_col = "time", condition_col = "condition", participant_col = "participant", design = "within", condition_a = NULL, condition_b = NULL, n_permutations = 1000, cluster_forming_alpha = 0.05, cluster_alpha = 0.05, tail = c("two.sided", "positive", "negative"), seed = NULL, time_bin_width = NULL, aggregation = c("mean", "median") )
data |
A data frame, preferably returned by
|
outcome_col |
Name of the numeric outcome column. |
time_col |
Name of the numeric time column. |
condition_col |
Name of the condition column. |
participant_col |
Name of the participant identifier column. |
design |
Currently only |
condition_a |
Optional first condition level. The tested difference is
|
condition_b |
Optional second condition level. |
n_permutations |
Number of sign-flip permutations. |
cluster_forming_alpha |
Per-time-point alpha used only to form clusters. |
cluster_alpha |
Cluster-level alpha used for the |
tail |
Test tail. Currently |
seed |
Optional random seed. |
time_bin_width |
Optional time-bin width passed to
|
aggregation |
Aggregation rule passed to
|
The function computes a paired t-statistic at each time point using participant-level condition differences, forms temporal clusters from adjacent suprathreshold time points, uses summed absolute t-statistics as cluster mass, and compares observed cluster masses with a sign-flip permutation null distribution.
An object of class gazepoint_cluster_permutation.
This helper tests the global null of no condition difference anywhere in the tested time range. A significant cluster indicates evidence against that global null under the permutation scheme. It does not establish the precise onset, offset, latency, or physiological timing of an effect. Avoid wording such as "the effect starts at X ms". Prefer conservative wording such as "the cluster-based permutation test indicated a condition difference in the tested time course".
This function is intentionally not implemented as a runnable inferential engine. It exists to make the unsupported scope explicit.
run_gazepoint_cluster_permutation_anova(...)run_gazepoint_cluster_permutation_anova(...)
... |
Ignored. |
This function always errors.
This function is intentionally not implemented as a runnable inferential engine.
run_gazepoint_cluster_permutation_covariate_adjusted(...)run_gazepoint_cluster_permutation_covariate_adjusted(...)
... |
Ignored. |
This function always errors.
This function is intentionally not implemented as a runnable inferential engine.
run_gazepoint_cluster_permutation_lmer(...)run_gazepoint_cluster_permutation_lmer(...)
... |
Ignored. |
This function always errors.
This function is intentionally not implemented as a separate backend.
run_gazepoint_cluster_permutation_parallel(...)run_gazepoint_cluster_permutation_parallel(...)
... |
Ignored. |
This function always errors.
Re-runs run_gazepoint_cluster_permutation() across several cluster-forming
thresholds and summarizes whether the broad result is stable.
run_gazepoint_cluster_threshold_sensitivity( data, dv, time, condition, subject, thresholds = c(0.01, 0.025, 0.05, 0.1), cluster_alpha = 0.05, seed = NULL, ... )run_gazepoint_cluster_threshold_sensitivity( data, dv, time, condition, subject, thresholds = c(0.01, 0.025, 0.05, 0.1), cluster_alpha = 0.05, seed = NULL, ... )
data |
A data frame. |
dv |
Numeric outcome column. |
time |
Time-bin column. |
condition |
Condition column. |
subject |
Participant identifier column. |
thresholds |
Numeric vector of cluster-forming thresholds. |
cluster_alpha |
Cluster-level alpha used for counting significant clusters in the summary. |
seed |
Optional seed. If provided, each threshold receives a deterministic seed offset. |
... |
Additional arguments passed to
|
An object of class gazepoint_cluster_threshold_sensitivity.
Runs a conservative six-phase Gazepoint EDA/GSR workflow using native
gpbiometrics helpers where possible. The function imports or accepts data,
audits signal quality, prepares preprocessing outputs, creates optional
external-method bridge inputs, prepares synchronization/model-formatting
outputs, attaches model templates, and generates reporting outputs.
run_gazepoint_eda_analysis_pipeline( data = NULL, path = NULL, eda_col = NULL, time_col = NULL, group_cols = NULL, signal_cols = NULL, sampling_rate = NULL, baseline_window = NULL, event_windows = NULL, event_data = NULL, lag_signal_pair = NULL, convert_resistance_to_us = FALSE, prepare_external_bridges = TRUE, bridge_methods = c("neurokit", "cvxeda", "ledalab", "pspm"), prepare_model_data = TRUE, create_reports = TRUE, output_dir = NULL, prefix = "gazepoint_eda_pipeline", continue_on_error = TRUE )run_gazepoint_eda_analysis_pipeline( data = NULL, path = NULL, eda_col = NULL, time_col = NULL, group_cols = NULL, signal_cols = NULL, sampling_rate = NULL, baseline_window = NULL, event_windows = NULL, event_data = NULL, lag_signal_pair = NULL, convert_resistance_to_us = FALSE, prepare_external_bridges = TRUE, bridge_methods = c("neurokit", "cvxeda", "ledalab", "pspm"), prepare_model_data = TRUE, create_reports = TRUE, output_dir = NULL, prefix = "gazepoint_eda_pipeline", continue_on_error = TRUE )
data |
Optional Gazepoint biometric data frame or imported object. |
path |
Optional file or folder path. Used only when |
eda_col |
Optional EDA/conductance column. If omitted, the runner
prefers |
time_col |
Optional time/counter column. |
group_cols |
Optional grouping columns. |
signal_cols |
Optional biometric signal columns for activity plots and signal audits. |
sampling_rate |
Optional sampling rate in Hz, used when |
baseline_window |
Optional baseline window object passed to baseline correction helpers when supported. |
event_windows |
Optional event-window table used for SCR event-window summaries when available. |
event_data |
Optional event table used for TTL/event alignment when available. |
lag_signal_pair |
Optional character vector of length two giving signals for lag estimation. |
convert_resistance_to_us |
Logical. If |
prepare_external_bridges |
Logical. If |
bridge_methods |
Character vector containing any of |
prepare_model_data |
Logical. If |
create_reports |
Logical. If |
output_dir |
Optional output directory for report bundles or bridge files where supported. |
prefix |
File prefix used by output-producing helpers where supported. |
continue_on_error |
Logical. If |
The function does not fit brms or lme4 models, does not run external
software, and does not infer emotion, valence, stress, trust, preference,
cognition, or diagnosis.
A list with overview, phases, errors, pipeline_guide,
model_templates, reporting_guidance, interpretation_guardrails, and
settings.
If Python HeartPy is available through reticulate, this function attempts to run heartpy.process() on the first group. Otherwise it returns native Gazepoint HeartPy-style results only.
run_gazepoint_heartpy_crosscheck( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, ... )run_gazepoint_heartpy_crosscheck( data, signal_col = NULL, time_col = NULL, group_cols = NULL, sampling_rate_hz = NULL, ... )
data |
Data frame containing Gazepoint pulse/PPG samples. |
signal_col |
Signal column. |
time_col |
Optional time column. |
group_cols |
Optional grouping columns. |
sampling_rate_hz |
Sampling rate in Hz. |
... |
Additional arguments passed to detect_gazepoint_ppg_peaks(). |
A list with native, heartpy, and heartpy_available.
This function is intentionally not implemented as a runnable inferential engine.
run_gazepoint_multidimensional_cluster_permutation(...)run_gazepoint_multidimensional_cluster_permutation(...)
... |
Ignored. |
This function always errors.
Optionally calls Python/NeuroKit2 on prepared EDA input. By default,
execute = FALSE, so no external dependency is required.
run_gazepoint_neurokit_eda_crosscheck( data, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, sampling_rate = NULL, execute = FALSE, python = "python", output_dir = tempdir(), prefix = "gazepoint_neurokit_crosscheck", keep_files = FALSE )run_gazepoint_neurokit_eda_crosscheck( data, eda_col = "GSR_US", time_col = NULL, group_cols = NULL, sampling_rate = NULL, execute = FALSE, python = "python", output_dir = tempdir(), prefix = "gazepoint_neurokit_crosscheck", keep_files = FALSE )
data |
A Gazepoint biometric data frame or
|
eda_col |
EDA/GSR signal column, used when |
time_col |
Optional time/counter column. |
group_cols |
Optional grouping columns. |
sampling_rate |
Sampling rate in Hz required for NeuroKit2 execution. |
execute |
Logical. If |
python |
Python executable. |
output_dir |
Directory for temporary/input/output files. |
prefix |
File prefix. |
keep_files |
Logical. If |
A list with overview, prepared_input, crosscheck_summary,
manifest, and settings.
Provides a safe, dependency-light decision-support/simulation helper for online design optimization. The function recommends the next condition by combining expected model-discrimination utility with optional exploration and balancing penalties.
run_gazepoint_online_design_optimization( candidate_table, condition_col = "condition", utility_col = "expected_utility", block_col = NULL, cost_col = NULL, previous_assignments = NULL, exploration_weight = 0.1, balance_weight = 0.1, maximise = TRUE )run_gazepoint_online_design_optimization( candidate_table, condition_col = "condition", utility_col = "expected_utility", block_col = NULL, cost_col = NULL, previous_assignments = NULL, exploration_weight = 0.1, balance_weight = 0.1, maximise = TRUE )
candidate_table |
A data frame containing candidate conditions. |
condition_col |
Candidate condition column. |
utility_col |
Expected utility/model-discrimination column. |
block_col |
Optional block column. |
cost_col |
Optional cost or burden column subtracted from utility. |
previous_assignments |
Optional previous condition assignments. |
exploration_weight |
Weight for favouring under-sampled conditions. |
balance_weight |
Weight for penalising over-sampled conditions. |
maximise |
Logical. If |
This function does not control stimulus presentation software and should not be used as autonomous real-time experiment control without separate ethical, preregistration, and software-integration review.
A list with overview, ranked_candidates, recommendation,
assignment_summary, and settings.
Run pyHRV-style Gazepoint HRV analysis
run_gazepoint_pyhrv_style( nni_ms = NULL, peaks = NULL, peak_time_col = "peak_time_s", time_unit = c("seconds", "milliseconds"), frequency_method = c("welch", "lomb", "ar") )run_gazepoint_pyhrv_style( nni_ms = NULL, peaks = NULL, peak_time_col = "peak_time_s", time_unit = c("seconds", "milliseconds"), frequency_method = c("welch", "lomb", "ar") )
nni_ms |
Numeric NN intervals in milliseconds. |
peaks |
Optional peak timestamps/table. Used if nni_ms is missing. |
peak_time_col |
Peak timestamp column if peaks is a data frame. |
time_unit |
Unit for peaks. |
frequency_method |
Frequency method. |
List with time-domain, frequency-domain, nonlinear, and intervals.
Runs the standard gpbiometrics workflow, workflow summary, and workflow diagnostic on one or more private Gazepoint export folders. Raw data, participant-level values, source filenames, and private paths are never retained in the returned object.
run_gazepoint_real_data_smoke( data_dir = Sys.getenv("GPBIOMETRICS_SMOKE_DIR", unset = ""), output_dir = NULL, dataset_mode = c("subdirectories", "root"), pattern = "\\.csv$", recursive = TRUE, workflow_args = list(), diagnostic_args = list(), workflow_runner = NULL, summary_runner = NULL, diagnostic_runner = NULL, stop_on_error = FALSE, write_results = FALSE, overwrite = FALSE, protect_repository = TRUE )run_gazepoint_real_data_smoke( data_dir = Sys.getenv("GPBIOMETRICS_SMOKE_DIR", unset = ""), output_dir = NULL, dataset_mode = c("subdirectories", "root"), pattern = "\\.csv$", recursive = TRUE, workflow_args = list(), diagnostic_args = list(), workflow_runner = NULL, summary_runner = NULL, diagnostic_runner = NULL, stop_on_error = FALSE, write_results = FALSE, overwrite = FALSE, protect_repository = TRUE )
data_dir |
Private external data directory. Defaults to
|
output_dir |
Optional directory for aggregate smoke-test outputs. This should remain outside the package repository. |
dataset_mode |
How datasets are identified. |
pattern |
Regular expression used to identify candidate input files. |
recursive |
Search recursively within each dataset directory? |
workflow_args |
Named list of additional arguments passed to
|
diagnostic_args |
Named list of additional arguments passed to
|
workflow_runner |
Optional workflow function. Defaults to
|
summary_runner |
Optional summary function. Defaults to
|
diagnostic_runner |
Optional diagnostic function. Defaults to
|
stop_on_error |
Stop after the first failed dataset? |
write_results |
Write aggregate CSV outputs to |
overwrite |
Permit replacement of existing aggregate output files? |
protect_repository |
Reject private input or generated output directories located inside the current package repository? |
The source directory should normally be outside the package repository and
supplied through the GPBIOMETRICS_SMOKE_DIR environment variable.
An object of class "gazepoint_real_data_smoke" containing only
privacy-safe aggregate results, condition summaries, runtime metadata,
and non-sensitive settings.
private_dir <- Sys.getenv("GPBIOMETRICS_SMOKE_DIR") if (nzchar(private_dir) && dir.exists(private_dir)) { smoke <- run_gazepoint_real_data_smoke( data_dir = private_dir ) smoke$results }private_dir <- Sys.getenv("GPBIOMETRICS_SMOKE_DIR") if (nzchar(private_dir) && dir.exists(private_dir)) { smoke <- run_gazepoint_real_data_smoke( data_dir = private_dir ) smoke$results }
Scores SCR amplitudes across multiple latency windows, thresholds, baseline methods, and response metrics. Optionally applies a user-supplied model function to each specification. This supports transparent sensitivity analysis and specification-curve style reporting.
run_gazepoint_scr_multiverse( dat, signal_col = "GSR_US", time_col = "time", trial_cols = NULL, condition_col = NULL, participant_col = NULL, event_time_col = NULL, latency_windows = list(c(1, 3), c(1, 4), c(1, 5)), thresholds = c(0.01, 0.05), baseline_methods = c("median", "mean"), baseline_window = c(-1, 0), response_metrics = c("max_minus_baseline"), model_function = NULL )run_gazepoint_scr_multiverse( dat, signal_col = "GSR_US", time_col = "time", trial_cols = NULL, condition_col = NULL, participant_col = NULL, event_time_col = NULL, latency_windows = list(c(1, 3), c(1, 4), c(1, 5)), thresholds = c(0.01, 0.05), baseline_methods = c("median", "mean"), baseline_window = c(-1, 0), response_metrics = c("max_minus_baseline"), model_function = NULL )
dat |
Sample-level EDA data. |
signal_col |
Conductance/EDA signal column. |
time_col |
Time column, preferably relative to stimulus onset. If
|
trial_cols |
Columns identifying trials. |
condition_col |
Optional experimental condition column. |
participant_col |
Optional participant column. |
event_time_col |
Optional event/stimulus onset time column. |
latency_windows |
List of response windows in seconds. |
thresholds |
SCR response thresholds. |
baseline_methods |
Baseline methods: |
baseline_window |
Baseline window in relative seconds. |
response_metrics |
Response metrics: |
model_function |
Optional function applied to each specification-level trial summary. |
A list with specification grid, scored trials, optional model results, and robustness overview.
Re-runs SCR peak detection across combinations of amplitude thresholds and minimum peak-distance settings. Optionally, it also carries each peak-detection result through SCR event-window summaries so users can see how preprocessing choices affect event-level response rates.
run_gazepoint_scr_threshold_sensitivity( data, phasic_col = NULL, signal_col = NULL, time_col = NULL, group_cols = NULL, amplitude_min_values = c(0.005, 0.01, 0.02, 0.03), min_peak_distance_values = c(1, 5, 10, 20, 30), recovery_fraction = 0.5, smooth_width = 1, events = NULL, event_time_col = NULL, event_id_col = NULL, event_label_col = NULL, ttl_cols = NULL, ttl_valid_col = NULL, event_detection = c("rising", "active"), analysis_window = c(0, 6), response_window = c(1, 4), peak_selection = c("largest_amplitude", "first_peak"), collapse_simultaneous_events = FALSE, include_event_windows = TRUE, keep_objects = FALSE )run_gazepoint_scr_threshold_sensitivity( data, phasic_col = NULL, signal_col = NULL, time_col = NULL, group_cols = NULL, amplitude_min_values = c(0.005, 0.01, 0.02, 0.03), min_peak_distance_values = c(1, 5, 10, 20, 30), recovery_fraction = 0.5, smooth_width = 1, events = NULL, event_time_col = NULL, event_id_col = NULL, event_label_col = NULL, ttl_cols = NULL, ttl_valid_col = NULL, event_detection = c("rising", "active"), analysis_window = c(0, 6), response_window = c(1, 4), peak_selection = c("largest_amplitude", "first_peak"), collapse_simultaneous_events = FALSE, include_event_windows = TRUE, keep_objects = FALSE )
data |
A Gazepoint biometric data frame. |
phasic_col |
Optional phasic EDA signal column, typically
|
signal_col |
Optional conductance-like fallback signal column, typically
|
time_col |
Optional time/counter column. |
group_cols |
Optional grouping columns. |
amplitude_min_values |
Numeric vector of SCR amplitude thresholds. |
min_peak_distance_values |
Numeric vector of minimum peak distances. |
recovery_fraction |
Fraction used by |
smooth_width |
Optional moving-average width passed to
|
events |
Optional event table passed to
|
event_time_col |
Optional event-time column when |
event_id_col |
Optional event identifier column when |
event_label_col |
Optional event label column when |
ttl_cols |
Optional TTL columns for event derivation when |
ttl_valid_col |
Optional TTL validity column. |
event_detection |
Event-detection rule for TTL columns. |
analysis_window |
Event-relative analysis window. |
response_window |
Event-relative response window. |
peak_selection |
Peak-selection rule for event-window summaries. |
collapse_simultaneous_events |
Logical. Passed to
|
include_event_windows |
Logical. If |
keep_objects |
Logical. If |
A list with overview, sensitivity_grid,
peak_group_summary, event_window_summary, optional objects, and
settings.
This function is intentionally not implemented as a runnable inferential engine.
run_gazepoint_tfce(...)run_gazepoint_tfce(...)
... |
Ignored. |
This function always errors.
Launches an optional local Shiny interface for inspecting a Gazepoint Biometrics CSV file. Shiny is optional and is not required to use the package.
run_gpbiometrics_shiny()run_gpbiometrics_shiny()
A Shiny application object, launched for interactive use.
Launches a local Shiny app for manual EDA peak/artifact annotation. The app lets users upload a Gazepoint CSV, inspect a selected signal, enter manual peak/artifact intervals, and download annotation CSVs.
run_gpbiometrics_shiny_annotator()run_gpbiometrics_shiny_annotator()
This is an optional local GUI helper. It does not replace automated scoring or infer emotion, stress, cognition, trust, preference, or diagnosis.
A Shiny application object, launched for interactive use.
Scale Gazepoint pulse/PPG signals within sections
scale_gazepoint_ppg_sections( data, signal_col = NULL, section_cols = NULL, method = c("zscore", "minmax", "robust", "center", "none"), output_col = "ppg_scaled", range = c(0, 1) )scale_gazepoint_ppg_sections( data, signal_col = NULL, section_cols = NULL, method = c("zscore", "minmax", "robust", "center", "none"), output_col = "ppg_scaled", range = c(0, 1) )
data |
Data frame or numeric signal. |
signal_col |
Signal column when data is a data frame. |
section_cols |
Optional section/grouping columns. |
method |
Scaling method. |
output_col |
Name of the scaled output column. |
range |
Output range for minmax scaling. |
Data frame with an added scaled column, or a scaled vector for numeric input.
Scale a Gazepoint pulse/PPG signal
scale_gazepoint_ppg_signal( x, method = c("zscore", "minmax", "robust", "center", "none"), range = c(0, 1) )scale_gazepoint_ppg_signal( x, method = c("zscore", "minmax", "robust", "center", "none"), range = c(0, 1) )
x |
Numeric signal. |
method |
Scaling method: zscore, minmax, robust, center, or none. |
range |
Output range for minmax scaling. |
Scaled numeric vector.
Preserves the conventional threshold/non-responder flag but estimates a Beta-Binomial posterior response probability and retains low-reactive participants for model-based sensitivity analyses.
scr_responsivity_sensitivity( participant, amplitude, threshold = 0.02, prior_alpha = 1, prior_beta = 1 )scr_responsivity_sensitivity( participant, amplitude, threshold = 0.02, prior_alpha = 1, prior_beta = 1 )
participant |
Participant identifiers. |
amplitude |
Trial-level SCR amplitudes. |
threshold |
Conventional response threshold in microsiemens. |
prior_alpha, prior_beta
|
Beta prior parameters. |
A data frame with conventional and posterior responsivity summaries.
Screens groups, usually participants, for low or absent SCR responding using either SCR event-window summaries or SCR peak-detection outputs. The helper reports candidate nonresponders under explicit, user-controlled criteria.
screen_gazepoint_eda_nonresponders( x, group_cols = NULL, response_col = "response_flag", amplitude_col = "scr_amplitude", min_events = 1, min_response_events = 1, min_response_rate = 0.05, min_detected_peaks = 1 )screen_gazepoint_eda_nonresponders( x, group_cols = NULL, response_col = "response_flag", amplitude_col = "scr_amplitude", min_events = 1, min_response_events = 1, min_response_rate = 0.05, min_detected_peaks = 1 )
x |
A |
group_cols |
Optional grouping columns, usually participant columns. |
response_col |
Binary response column for event-window data. |
amplitude_col |
SCR amplitude column. |
min_events |
Minimum number of events required before event-window nonresponder classification is made. |
min_response_events |
Minimum number of response events required. |
min_response_rate |
Minimum response rate required. |
min_detected_peaks |
Minimum detected peaks required when only peak data are available. |
A list with overview, group_summary, candidate_nonresponders,
and settings.
Segment NN intervals into time windows
segment_gazepoint_pyhrv_nni( nni_ms, segment_seconds = 300, overlap = 0, min_intervals = 3L )segment_gazepoint_pyhrv_nni( nni_ms, segment_seconds = 300, overlap = 0, min_intervals = 3L )
nni_ms |
Numeric NN intervals in milliseconds. |
segment_seconds |
Segment duration. |
overlap |
Segment overlap proportion. |
min_intervals |
Minimum intervals per segment. |
Data frame with segment membership.
Record gpbiometrics session information
session_info_gazepoint( packages = NULL, include_loaded = TRUE, timestamp = Sys.time() )session_info_gazepoint( packages = NULL, include_loaded = TRUE, timestamp = Sys.time() )
packages |
Optional additional packages to report. |
include_loaded |
Include loaded namespaces. |
timestamp |
Timestamp recorded in the output. |
A "gazepoint_session_info" object containing system metadata,
package versions, and printable session text.
Adds transparent, rule-based synthetic artifacts to selected numeric signal columns. The function is intended for testing QC pipelines and does not interpret the physiological meaning of any signal.
simulate_gazepoint_artifact( data, signal_cols, artifact = c("missing_run", "flatline", "spike"), n_artifacts = 1, artifact_length = 5, magnitude = NULL, seed = NULL, suffix = "_artifact", overwrite = FALSE )simulate_gazepoint_artifact( data, signal_cols, artifact = c("missing_run", "flatline", "spike"), n_artifacts = 1, artifact_length = 5, magnitude = NULL, seed = NULL, suffix = "_artifact", overwrite = FALSE )
data |
A data frame. |
signal_cols |
Character vector of numeric signal columns. |
artifact |
Character vector of artifact types. Supported values are
|
n_artifacts |
Number of artifacts of each requested type to add per signal column. |
artifact_length |
Number of rows affected by each inserted artifact. |
magnitude |
Optional numeric artifact magnitude. If |
seed |
Optional random seed for reproducible artifact placement. |
suffix |
Suffix used for new artifact-injected columns when
|
overwrite |
Logical. If |
A list with class gazepoint_artifact_simulation, containing
the modified data, an artifact log, and the parameters used.
Generates synthetic Gazepoint-style EDA, PPG, HR, IBI, and TTL-like signals with known ground-truth events. This is intended for teaching, examples, unit tests, and model-validation workflows. It does not generate real participant physiology.
simulate_gazepoint_biometrics( n_seconds = 120, sampling_rate = 60, participant_id = "sim_p1", scr_onsets = NULL, scr_rate_per_min = 4, pulse_rate_bpm = 72, respiration_rate_bpm = 15, eda_noise_sd = 0.01, ppg_noise_sd = 0.02, include_ttl = TRUE, seed = NULL )simulate_gazepoint_biometrics( n_seconds = 120, sampling_rate = 60, participant_id = "sim_p1", scr_onsets = NULL, scr_rate_per_min = 4, pulse_rate_bpm = 72, respiration_rate_bpm = 15, eda_noise_sd = 0.01, ppg_noise_sd = 0.02, include_ttl = TRUE, seed = NULL )
n_seconds |
Duration in seconds. |
sampling_rate |
Sampling rate in Hz. |
participant_id |
Participant identifier. |
scr_onsets |
Optional SCR onset times in seconds. |
scr_rate_per_min |
Expected SCR events per minute when |
pulse_rate_bpm |
Mean pulse rate. |
respiration_rate_bpm |
Respiration-modulation rate. |
eda_noise_sd |
EDA noise SD. |
ppg_noise_sd |
PPG noise SD. |
include_ttl |
Logical. If |
seed |
Optional random seed. |
A list with overview, data, ground_truth, and settings.
Creates participant-level synthetic time-course data with an optional effect window. The function is intended for examples, tests, teaching, and documentation.
simulate_gazepoint_cluster_timecourse_data( n_subjects = 12L, n_time = 60L, conditions = c("A", "B"), effect_start = 25, effect_end = 38, effect_size = 0.6, noise_sd = 0.4, subject_sd = 0.25, time_start = 1, time_step = 1, effect_condition = "B", seed = NULL )simulate_gazepoint_cluster_timecourse_data( n_subjects = 12L, n_time = 60L, conditions = c("A", "B"), effect_start = 25, effect_end = 38, effect_size = 0.6, noise_sd = 0.4, subject_sd = 0.25, time_start = 1, time_step = 1, effect_condition = "B", seed = NULL )
n_subjects |
Number of participants. |
n_time |
Number of time bins. |
conditions |
Character vector of two condition labels. |
effect_start |
First time value included in the effect window. |
effect_end |
Last time value included in the effect window. |
effect_size |
Additive effect size inside the effect window. |
noise_sd |
Standard deviation of observation-level noise. |
subject_sd |
Standard deviation of participant-level random intercepts. |
time_start |
First time value. |
time_step |
Step between time bins. |
effect_condition |
Condition receiving the additive effect. |
seed |
Optional random seed. |
A data frame with columns subject, condition, time, value,
and true_effect.
Generates synthetic Gazepoint-like eye-tracking data with time stamps, gaze coordinates, fixation identifiers, pupil diameter, validity columns, and random blink intervals. The output is intended for teaching, examples, testing, smoke tests, and vignette demonstrations; it is not a physiological ground-truth simulator.
simulate_gazepoint_eye_data(params = list())simulate_gazepoint_eye_data(params = list())
params |
Named list of simulation parameters. Supported entries include
|
A data frame with Gazepoint-style columns, including time_s,
MSTIMER, BPOGX, BPOGY, FPOGX, FPOGY, LPD, RPD, LPV, RPV,
fixation_id, in_blink, blink_id, participant, and trial.
dat <- simulate_gazepoint_eye_data(list(n = 120, seed = 1)) head(dat)dat <- simulate_gazepoint_eye_data(list(n = 120, seed = 1)) head(dat)
Generates deterministic synthetic biometric, pupil/gaze, event, AOI, and fixation tables for tests, examples, and smoke-test workflows. The output is for software demonstration only and should not be treated as physiological validation data.
simulate_gazepoint_multimodal_data( n = NULL, duration_s = 20, sampling_rate_hz = 50, seed = 1, participant = "P01", n_trials = 4 )simulate_gazepoint_multimodal_data( n = NULL, duration_s = 20, sampling_rate_hz = 50, seed = 1, participant = "P01", n_trials = 4 )
n |
Number of samples. |
duration_s |
Recording duration in seconds. |
sampling_rate_hz |
Sampling rate in Hz. If supplied, overrides |
seed |
Optional random seed. |
participant |
Participant identifier. |
n_trials |
Number of trial/event periods. |
Named list with biometrics, eye, events, fixations, and
metadata.
Adds a simple centered moving-average smoothing column to a Gazepoint Biometrics table. This is intentionally conservative and dependency-free. It does not replace specialised biosignal preprocessing libraries.
smooth_gazepoint_biometrics( data, value_column, window = 5L, output_column = NULL, na_rm = TRUE )smooth_gazepoint_biometrics( data, value_column, window = 5L, output_column = NULL, na_rm = TRUE )
data |
A data frame or a path to a Gazepoint CSV export. |
value_column |
Column to smooth. |
window |
Number of samples in the moving window. Must be a positive odd integer. |
output_column |
Name of the smoothed output column. |
na_rm |
Should missing values be ignored within the moving window? |
A data frame with the added smoothed column.
Smooth a Gazepoint pulse/PPG signal
smooth_gazepoint_ppg_signal( x, sampling_rate_hz, method = c("mean", "median"), window_seconds = 0.1 )smooth_gazepoint_ppg_signal( x, sampling_rate_hz, method = c("mean", "median"), window_seconds = 0.1 )
x |
Numeric signal. |
sampling_rate_hz |
Sampling rate in Hz. |
method |
Smoothing method: mean or median. |
window_seconds |
Smoothing window length. |
Smoothed numeric signal.
Applies a simple centred moving-average smoother to Gazepoint pupil columns. The function is intended for transparent preprocessing and quality-control workflows. It does not interpolate long missing gaps and does not interpret pupil values as psychological or physiological states.
smooth_gazepoint_pupil( data, pupil_cols = NULL, id_cols = NULL, window = 5L, suffix = "_smooth", min_nonmissing = 1L )smooth_gazepoint_pupil( data, pupil_cols = NULL, id_cols = NULL, window = 5L, suffix = "_smooth", min_nonmissing = 1L )
data |
A data frame containing Gazepoint pupil data. |
pupil_cols |
Character vector naming pupil columns. If |
id_cols |
Optional character vector naming grouping columns. Smoothing is applied within groups. |
window |
Positive odd integer giving the moving-average window size. |
suffix |
Suffix appended to smoothed pupil-column names. |
min_nonmissing |
Minimum number of non-missing values required inside a window to compute a smoothed value. |
A list with the processed data, a summary table, and settings. The
object has class "gazepoint_pupil_smoothing".
d <- data.frame( participant = rep("P01", 6), pupil_left = c(3.0, 3.2, 3.4, NA, 3.3, 3.1) ) smooth_gazepoint_pupil(d, pupil_cols = "pupil_left", window = 3)d <- data.frame( participant = rep("P01", 6), pupil_left = c(3.0, 3.2, 3.4, NA, 3.3, 3.1) ) smooth_gazepoint_pupil(d, pupil_cols = "pupil_left", window = 3)
Split Gazepoint recordings into PsPM-style sessions
split_gazepoint_sessions_pspm_style( data, time_col = NULL, gap_seconds = NULL, session_col = "pspm_session", reset_time = TRUE )split_gazepoint_sessions_pspm_style( data, time_col = NULL, gap_seconds = NULL, session_col = "pspm_session", reset_time = TRUE )
data |
Gazepoint data frame. |
time_col |
Time column. |
gap_seconds |
Gap threshold. If NULL, inferred from sampling interval. |
session_col |
Output session column. |
reset_time |
If TRUE, add session-relative time. |
List with annotated data, sessions, and split data.
Applies dependency-light adaptive normalization using an exponential moving average center and robust local scale after IQR-based outlier screening. This preserves local dynamics more than whole-session z-scoring, but it is still a preprocessing transformation and not an emotion/stress classifier.
standardise_gazepoint_adaptive_ema( dat, signal_col = "GSR_US", group_cols = NULL, time_col = NULL, alpha = 0.05, iqr_multiplier = 1.5, suffix = "_adaptive_ema", center_suffix = "_ema_center", scale_suffix = "_ema_scale", min_scale = 1e-08, overwrite = FALSE ) standardize_gazepoint_adaptive_ema( dat, signal_col = "GSR_US", group_cols = NULL, time_col = NULL, alpha = 0.05, iqr_multiplier = 1.5, suffix = "_adaptive_ema", center_suffix = "_ema_center", scale_suffix = "_ema_scale", min_scale = 1e-08, overwrite = FALSE )standardise_gazepoint_adaptive_ema( dat, signal_col = "GSR_US", group_cols = NULL, time_col = NULL, alpha = 0.05, iqr_multiplier = 1.5, suffix = "_adaptive_ema", center_suffix = "_ema_center", scale_suffix = "_ema_scale", min_scale = 1e-08, overwrite = FALSE ) standardize_gazepoint_adaptive_ema( dat, signal_col = "GSR_US", group_cols = NULL, time_col = NULL, alpha = 0.05, iqr_multiplier = 1.5, suffix = "_adaptive_ema", center_suffix = "_ema_center", scale_suffix = "_ema_scale", min_scale = 1e-08, overwrite = FALSE )
dat |
A data frame. |
signal_col |
Numeric signal column. |
group_cols |
Optional grouping columns. |
time_col |
Optional time column used to order rows within group. |
alpha |
EMA smoothing parameter in |
iqr_multiplier |
IQR multiplier for outlier screening. |
suffix |
Suffix for the normalized output column. |
center_suffix |
Suffix for the EMA center column. |
scale_suffix |
Suffix for the EMA scale column. |
min_scale |
Minimum scale used to avoid division by zero. |
overwrite |
Logical. If |
A data frame with adaptive normalized signal columns and attributes.
Standardises common Gazepoint Biometrics column-name variants to stable canonical names. The helper is intentionally conservative: it recognises common biometric, timing, marker, participant, and stimulus columns, but it leaves unknown columns unchanged apart from optional snake-case cleaning.
standardise_gazepoint_biometric_names( data, style = c("canonical", "snake"), rename = TRUE )standardise_gazepoint_biometric_names( data, style = c("canonical", "snake"), rename = TRUE )
data |
A data frame or a character vector of column names. |
style |
Naming style to return. |
rename |
Logical. If |
If data is a character vector, a character vector of standardised
names. If data is a data frame and rename = TRUE, the data frame with
standardised names. If rename = FALSE, a data frame mapping original names
to standardised names.
standardise_gazepoint_biometric_names(c("time ms", "heart rate", "eda uS")) df <- data.frame(`time ms` = 1:3, `heart rate` = c(70, 72, 71)) names(standardise_gazepoint_biometric_names(df))standardise_gazepoint_biometric_names(c("time ms", "heart rate", "eda uS")) df <- data.frame(`time ms` = 1:3, `heart rate` = c(70, 72, 71)) names(standardise_gazepoint_biometric_names(df))
Adds consistent attributes to a ggplot object so plotting helpers can be tested and reused in automated reports.
standardise_gazepoint_plot_contract( plot, plot_data = NULL, settings = list(), interpretation_notes = NULL, plot_type = NULL )standardise_gazepoint_plot_contract( plot, plot_data = NULL, settings = list(), interpretation_notes = NULL, plot_type = NULL )
plot |
A ggplot object. |
plot_data |
Optional data frame used to create the plot. |
settings |
Optional list of plot settings. |
interpretation_notes |
Optional character vector of interpretation notes. |
plot_type |
Optional short plot-type label. |
A ggplot object with standardized attributes.
Adds a range-corrected signal column using (x - min) / (max - min) within
participant or another grouping unit. This expresses each value as a
proportion of the observed within-unit range.
standardise_gazepoint_range_correction( dat, signal_col, group_col = "source_participant", suffix = "_Range_Corrected", min_valid = 2, zero_range_action = c("NA", "zero"), overwrite = FALSE ) standardize_gazepoint_range_correction( dat, signal_col, group_col = "source_participant", suffix = "_Range_Corrected", min_valid = 2, zero_range_action = c("NA", "zero"), overwrite = FALSE )standardise_gazepoint_range_correction( dat, signal_col, group_col = "source_participant", suffix = "_Range_Corrected", min_valid = 2, zero_range_action = c("NA", "zero"), overwrite = FALSE ) standardize_gazepoint_range_correction( dat, signal_col, group_col = "source_participant", suffix = "_Range_Corrected", min_valid = 2, zero_range_action = c("NA", "zero"), overwrite = FALSE )
dat |
A data frame containing SCR, SCL, or another biometric signal. |
signal_col |
Signal column to range-correct. |
group_col |
Participant or unit column. |
suffix |
Suffix for the output column. |
min_valid |
Minimum finite observations required within each group. |
zero_range_action |
What to do when max equals min: |
overwrite |
Logical. If |
A data frame with an added range-corrected column.
Adds a within-participant z-scored version of a signal column. This is a lightweight compatibility wrapper around the package's more general within-unit standardisation helper.
standardise_gazepoint_zscore( dat, signal_col = "SCR_Amplitude", group_col = "source_participant", suffix = "_Z", min_valid = 2, overwrite = FALSE ) standardize_gazepoint_zscore( dat, signal_col = "SCR_Amplitude", group_col = "source_participant", suffix = "_Z", min_valid = 2, overwrite = FALSE )standardise_gazepoint_zscore( dat, signal_col = "SCR_Amplitude", group_col = "source_participant", suffix = "_Z", min_valid = 2, overwrite = FALSE ) standardize_gazepoint_zscore( dat, signal_col = "SCR_Amplitude", group_col = "source_participant", suffix = "_Z", min_valid = 2, overwrite = FALSE )
dat |
A data frame containing SCR, SCL, or another biometric signal. |
signal_col |
Signal column to standardise. |
group_col |
Participant or unit column. |
suffix |
Suffix for the output column. |
min_valid |
Minimum finite observations required within each group. |
overwrite |
Logical. If |
A data frame with an added z-scored column.
Adds within-unit standardized biometric columns, usually within participant or participant-by-session/stimulus groups. This is useful when the analysis focuses on relative within-person signal change rather than absolute between-person level differences.
standardize_gazepoint_biometrics_within_unit( data, signal_cols = NULL, unit_cols = NULL, reference_col = NULL, reference_value = TRUE, suffix = "_z_within", center = TRUE, scale = TRUE, min_valid = 2, zero_sd_action = c("NA", "zero"), overwrite = FALSE ) standardise_gazepoint_biometrics_within_unit( data, signal_cols = NULL, unit_cols = NULL, reference_col = NULL, reference_value = TRUE, suffix = "_z_within", center = TRUE, scale = TRUE, min_valid = 2, zero_sd_action = c("NA", "zero"), overwrite = FALSE )standardize_gazepoint_biometrics_within_unit( data, signal_cols = NULL, unit_cols = NULL, reference_col = NULL, reference_value = TRUE, suffix = "_z_within", center = TRUE, scale = TRUE, min_valid = 2, zero_sd_action = c("NA", "zero"), overwrite = FALSE ) standardise_gazepoint_biometrics_within_unit( data, signal_cols = NULL, unit_cols = NULL, reference_col = NULL, reference_value = TRUE, suffix = "_z_within", center = TRUE, scale = TRUE, min_valid = 2, zero_sd_action = c("NA", "zero"), overwrite = FALSE )
data |
A data frame containing Gazepoint biometric data. |
signal_cols |
Character vector of biometric signal columns to
standardize. If |
unit_cols |
Character vector defining the unit within which means and
standard deviations are computed. If |
reference_col |
Optional logical or categorical column identifying rows used to estimate the reference mean and standard deviation. For example, this can be a baseline-window flag. The resulting parameters are then applied to all rows in the same unit. |
reference_value |
Value in |
suffix |
Suffix for standardized output columns. |
center |
Logical. If |
scale |
Logical. If |
min_valid |
Minimum number of finite reference observations required per unit and signal. |
zero_sd_action |
What to do when the within-unit standard deviation is
zero or unavailable. |
overwrite |
Logical. If |
The helper is intentionally conservative. It does not run automatically in the main workflow and does not infer emotion, valence, stress, trust, preference, cognition, or diagnosis. Within-unit z-scoring removes between-unit level and scale differences and should therefore be reported explicitly.
A data frame with added standardized columns. Attributes include
standardization_summary, standardization_parameters, and settings.
Maps common Gazepoint-style export aliases to canonical names such as
time_s, participant, trial, pupil_left, pupil_right, gaze_x,
gaze_y, GSR, and PPG.
standardize_gazepoint_column_names( data, dictionary = NULL, conflict = c("suffix", "error", "keep"), ignore_case = TRUE )standardize_gazepoint_column_names( data, dictionary = NULL, conflict = c("suffix", "error", "keep"), ignore_case = TRUE )
data |
Data frame, or a named list of data frames. |
dictionary |
Optional named list mapping canonical names to aliases. |
conflict |
How to handle rename conflicts: |
ignore_case |
If TRUE, match aliases case-insensitively. |
Data frame, or list of data frames, with a
gazepoint_column_standardization attribute containing the rename audit.
Compatibility alias for standardize_gazepoint_column_names(). This exact
name is provided for users who search for a shorter column-standardization
helper.
standardize_gazepoint_columns(data, ...)standardize_gazepoint_columns(data, ...)
data |
Data frame or supported object passed to
|
... |
Additional arguments passed to
|
Standardized data object returned by
standardize_gazepoint_column_names().
US-spelling compatibility wrapper around
standardise_gazepoint_plot_contract(). The wrapper accepts either a single
ggplot object or a list of ggplot objects. For a list of plots, plot_data,
settings, interpretation_notes, and plot_type may be supplied either as
single values applied to all plots or as same-length lists/vectors applied
elementwise.
standardize_gazepoint_plot_contracts( plot, plot_data = NULL, settings = list(), interpretation_notes = NULL, plot_type = NULL )standardize_gazepoint_plot_contracts( plot, plot_data = NULL, settings = list(), interpretation_notes = NULL, plot_type = NULL )
plot |
A ggplot object, or a list of ggplot objects. |
plot_data |
Optional data frame, or a list of data frames when |
settings |
Optional settings list, or a list of settings lists when
|
interpretation_notes |
Optional character vector, or a list/character
vector of notes when |
plot_type |
Optional plot-type label, or a character vector/list of
labels when |
A standardized ggplot object, or a list of standardized ggplot objects.
Summarises Gazepoint biometric channels within area-of-interest (AOI) rows. The helper is intended for AOI-linked physiological descriptions, not for inferring emotional valence.
summarise_gazepoint_aoi_biometrics( data, aoi_col = "AOI", signal_cols = NULL, group_cols = NULL, time_col = NULL, valid_aoi_values = NULL, drop_missing_aoi = TRUE, min_rows = 1 )summarise_gazepoint_aoi_biometrics( data, aoi_col = "AOI", signal_cols = NULL, group_cols = NULL, time_col = NULL, valid_aoi_values = NULL, drop_missing_aoi = TRUE, min_rows = 1 )
data |
A Gazepoint data frame containing AOI labels and biometric signals. |
aoi_col |
AOI label column. |
signal_cols |
Biometric signal columns to summarise. |
group_cols |
Optional grouping columns, for example participant/media. |
time_col |
Optional time/counter column. |
valid_aoi_values |
Optional AOI labels to retain. |
drop_missing_aoi |
Logical. If |
min_rows |
Minimum rows required for a group/AOI/signal summary to be marked as usable. |
A list with overview, summary, signal_summary, aoi_summary,
data, and settings.
Summarises missingness, finite numeric availability, variability, and optional
validity-flag columns for Gazepoint Biometrics data. The helper is descriptive:
it reports whether biometric signals appear available and usable, but it does
not infer emotion, valence, or HRV from ambiguous raw columns. In particular,
raw HRV columns are treated as validity/vendor flags unless the user has
independent documentation proving otherwise.
summarise_gazepoint_biometric_validity( data, signal_cols = NULL, validity_cols = NULL, group_cols = NULL, active_min_unique = 2L )summarise_gazepoint_biometric_validity( data, signal_cols = NULL, validity_cols = NULL, group_cols = NULL, active_min_unique = 2L )
data |
A data frame. |
signal_cols |
Optional character vector of biometric signal columns to
summarise. If |
validity_cols |
Optional character vector of validity-flag columns to
summarise. If |
group_cols |
Optional character vector of grouping columns, such as participant, stimulus, trial, or condition columns. |
active_min_unique |
Minimum number of unique finite values required for a numeric signal to be treated as active. |
A list with overview, signals, validity_flags,
group_summary, and settings.
df <- data.frame( USER = rep(c("P1", "P2"), each = 4), GSR = c(1, 2, NA, 4, 2, 2, 2, 2), HR = c(70, 71, 72, NA, 80, 81, 82, 83), HRV = c(1, 1, 0, 1, 1, 1, 1, 1) ) summarise_gazepoint_biometric_validity(df, group_cols = "USER")df <- data.frame( USER = rep(c("P1", "P2"), each = 4), GSR = c(1, 2, NA, 4, 2, 2, 2, 2), HR = c(70, 71, 72, NA, 80, 81, 82, 83), HRV = c(1, 1, 0, 1, 1, 1, 1, 1) ) summarise_gazepoint_biometric_validity(df, group_cols = "USER")
Summarise the formatted gpbiometrics feature inventory
summarise_gazepoint_biometrics_feature_inventory(formatted_inventory = NULL)summarise_gazepoint_biometrics_feature_inventory(formatted_inventory = NULL)
formatted_inventory |
Optional table returned by
|
A list with domain, method-family, and user-level summaries.
Creates a compact summary table from an object returned by
run_gazepoint_biometrics_workflow().
summarise_gazepoint_biometrics_workflow(workflow)summarise_gazepoint_biometrics_workflow(workflow)
workflow |
A workflow object returned by
|
A one-row data frame summarising the workflow.
Summarise the number of recorded decisions by workflow stage, object type, decision label, and function name.
summarise_gazepoint_decision_log(log)summarise_gazepoint_decision_log(log)
log |
A decision log created with
|
A list with class "gazepoint_analysis_decision_log_summary".
Compatibility wrapper for summarise_gazepoint_engagement_windows(). This
helper uses the term "dial" for users who refer to Gazepoint engagement-dial
or self-reported engagement streams, while delegating the calculation to the
canonical engagement-window summariser.
summarise_gazepoint_dial_windows(data, ..., dial_col = NULL)summarise_gazepoint_dial_windows(data, ..., dial_col = NULL)
data |
A data frame containing Gazepoint Biometrics engagement/dial data. |
... |
Additional arguments passed to
|
dial_col |
Optional dial/engagement column. When supplied, it is mapped to the corresponding value-column argument of the underlying helper. |
The output of summarise_gazepoint_engagement_windows().
df <- data.frame( USER = rep(c("P1", "P2"), each = 3), DIAL = c(40, 45, 50, 55, 60, 65) ) summarise_gazepoint_dial_windows(df)df <- data.frame( USER = rep(c("P1", "P2"), each = 3), DIAL = c(40, 45, 50, 55, 60, 65) ) summarise_gazepoint_dial_windows(df)
Summarises Gazepoint engagement-dial values within participant, trial, stimulus, AOI, or other user-defined windows.
summarise_gazepoint_engagement_windows( data, group_columns = NULL, value_column = "DIAL", validity_column = "DIALV", exclude_zero = FALSE )summarise_gazepoint_engagement_windows( data, group_columns = NULL, value_column = "DIAL", validity_column = "DIALV", exclude_zero = FALSE )
data |
A data frame or a path to a Gazepoint CSV export. |
group_columns |
Optional grouping columns defining windows, such as
|
value_column |
Engagement-dial value column. Defaults to |
validity_column |
Engagement-dial validity column. Defaults to
|
exclude_zero |
Should zero values be excluded from usable summaries? |
A data frame with one row per window.
Produces participant-, trial-, and AOI-level fixation counts, duration summaries, dwell proportions, and optional first-fixation latency.
summarise_gazepoint_fixations_by_aoi( fixations, aoi_col = NULL, participant_col = NULL, trial_col = NULL, group_cols = NULL, start_col = NULL, end_col = NULL, duration_col = NULL, event_onset_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), duration_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, include_unassigned = FALSE, unassigned_label = "UNASSIGNED" )summarise_gazepoint_fixations_by_aoi( fixations, aoi_col = NULL, participant_col = NULL, trial_col = NULL, group_cols = NULL, start_col = NULL, end_col = NULL, duration_col = NULL, event_onset_col = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), duration_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, include_unassigned = FALSE, unassigned_label = "UNASSIGNED" )
fixations |
Fixation-level data frame. |
aoi_col |
AOI label column. |
participant_col |
Optional participant column. |
trial_col |
Optional trial column. |
group_cols |
Additional grouping columns. |
start_col |
Fixation-start column. |
end_col |
Optional fixation-end column. |
duration_col |
Optional fixation-duration column. |
event_onset_col |
Optional event/stimulus onset column. |
time_unit |
Unit for start, end, and event-onset values. |
duration_unit |
Unit for duration values. |
sampling_rate_hz |
Sampling frequency required when time or duration values are represented as sample indices. |
include_unassigned |
Include rows with missing or empty AOI labels. |
unassigned_label |
Label used for retained unassigned rows. |
A data frame of class "gazepoint_fixation_aoi_summary".
Creates a combined window-level summary table containing GSR/EDA, heart-rate, engagement-dial, and IBI-derived HRV summaries. This function is intended for biometric analyses where both continuous physiological values and interbeat-interval variability features are needed.
summarise_gazepoint_full_biometric_windows( data, group_columns, include_ibi_hrv = TRUE )summarise_gazepoint_full_biometric_windows( data, group_columns, include_ibi_hrv = TRUE )
data |
A data frame or a path to a Gazepoint CSV export. |
group_columns |
Columns defining analysis windows, such as
|
include_ibi_hrv |
Logical. Should IBI-derived HRV summaries be included? |
A data frame with one row per window and prefixed biometric summary columns.
Creates a simple descriptive tonic/phasic decomposition of a GSR/EDA signal. The tonic component is estimated with a rolling median, and the phasic component is the observed signal minus the rolling-median tonic estimate.
summarise_gazepoint_gsr_tonic_phasic( data, gsr_col = NULL, group_cols = NULL, time_col = NULL, window_n = 15L, peak_threshold = NULL, output_prefix = "gsr" )summarise_gazepoint_gsr_tonic_phasic( data, gsr_col = NULL, group_cols = NULL, time_col = NULL, window_n = 15L, peak_threshold = NULL, output_prefix = "gsr" )
data |
A data frame. |
gsr_col |
Optional GSR/EDA column. If |
group_cols |
Optional grouping columns. Tonic/phasic values are computed separately within each group. |
time_col |
Optional time column used to order rows within groups. |
window_n |
Rolling-median window size in samples. |
peak_threshold |
Optional phasic peak threshold. If |
output_prefix |
Prefix for generated columns. |
This is a lightweight descriptive helper, not a full skin-conductance-response deconvolution model. It should be used for quality checks, window summaries, and exploratory reporting unless a study requires a specialised EDA model.
A list with data, summary, and settings.
df <- data.frame( CNT = 1:10, GSR_US = c(1, 1.1, 1.0, 1.2, 2.0, 1.3, 1.2, 1.1, 1.0, 1.1) ) summarise_gazepoint_gsr_tonic_phasic(df, window_n = 3)df <- data.frame( CNT = 1:10, GSR_US = c(1, 1.1, 1.0, 1.2, 2.0, 1.3, 1.2, 1.1, 1.0, 1.1) ) summarise_gazepoint_gsr_tonic_phasic(df, window_n = 3)
Summarises Gazepoint GSR/EDA values within participant, trial, stimulus, AOI,
or other user-defined windows. When available, GSR_US is used by default
because it represents skin conductance in microsiemens in Gazepoint exports.
summarise_gazepoint_gsr_windows( data, group_columns = NULL, value_column = NULL, validity_column = "GSRV", exclude_zero = TRUE )summarise_gazepoint_gsr_windows( data, group_columns = NULL, value_column = NULL, validity_column = "GSRV", exclude_zero = TRUE )
data |
A data frame or a path to a Gazepoint CSV export. |
group_columns |
Optional grouping columns defining windows, such as
|
value_column |
Optional GSR/EDA value column. If |
validity_column |
Optional validity column. Defaults to |
exclude_zero |
Should zero values be excluded from usable summaries? |
A data frame with one row per window.
Summarises Gazepoint heart-rate values within participant, trial, stimulus,
AOI, or other user-defined windows. HRV is treated as a validity flag, not
as a heart-rate-variability metric.
summarise_gazepoint_hr_windows( data, group_columns = NULL, value_column = "HR", validity_column = "HRV", exclude_zero = TRUE )summarise_gazepoint_hr_windows( data, group_columns = NULL, value_column = "HR", validity_column = "HRV", exclude_zero = TRUE )
data |
A data frame or a path to a Gazepoint CSV export. |
group_columns |
Optional grouping columns defining windows, such as
|
value_column |
Heart-rate value column. Defaults to |
validity_column |
Heart-rate validity column. Defaults to |
exclude_zero |
Should zero values be excluded from usable summaries? |
A data frame with one row per window.
Computes conservative time-domain HRV-style features from genuine interbeat
interval or RR interval columns. The raw Gazepoint HRV column is not used
as an HRV metric because it is treated as a validity/vendor flag unless
independently documented otherwise.
summarise_gazepoint_hrv_features( data, ibi_col = NULL, group_cols = NULL, time_col = NULL, ibi_unit = c("auto", "seconds", "milliseconds"), min_ibi_ms = 300, max_ibi_ms = 2000, min_valid_ibi = 3L )summarise_gazepoint_hrv_features( data, ibi_col = NULL, group_cols = NULL, time_col = NULL, ibi_unit = c("auto", "seconds", "milliseconds"), min_ibi_ms = 300, max_ibi_ms = 2000, min_valid_ibi = 3L )
data |
A data frame. |
ibi_col |
Optional IBI/RR interval column. If |
group_cols |
Optional grouping columns, such as participant, stimulus, trial, or window. |
time_col |
Optional time/order column used to order IBI values within each group before calculating successive-difference features. |
ibi_unit |
Unit of the IBI/RR column. Use |
min_ibi_ms |
Minimum plausible IBI in milliseconds. |
max_ibi_ms |
Maximum plausible IBI in milliseconds. |
min_valid_ibi |
Minimum number of valid IBI values required before a group is marked as having computed HRV features. |
The helper computes descriptive features including mean IBI, mean heart rate derived from IBI, SDNN, RMSSD, and pNN50. It does not compute frequency-domain HRV and does not replace specialised ECG/PPG HRV software.
A list with overview, features, and settings.
df <- data.frame( participant = "P1", IBI = c(0.9, 1.0, 1.1, 1.0, 0.95) ) summarise_gazepoint_hrv_features(df, group_cols = "participant")df <- data.frame( participant = "P1", IBI = c(0.9, 1.0, 1.1, 1.0, 0.95) ) summarise_gazepoint_hrv_features(df, group_cols = "participant")
Summarises interbeat-interval (IBI) values within participant, stimulus,
trial, AOI, or other user-defined windows. This function derives simple
time-domain variability features from IBI. It does not use the Gazepoint
HRV column as a heart-rate-variability metric, because HRV is treated as
the Gazepoint heart-rate validity flag.
summarise_gazepoint_ibi_hrv_windows( data, group_columns, ibi_column = "IBI", validity_column = "HRV", min_ibi = 0.3, max_ibi = 2 )summarise_gazepoint_ibi_hrv_windows( data, group_columns, ibi_column = "IBI", validity_column = "HRV", min_ibi = 0.3, max_ibi = 2 )
data |
A data frame or a path to a Gazepoint CSV export. |
group_columns |
Columns defining analysis windows, such as
|
ibi_column |
Interbeat-interval column. Defaults to |
validity_column |
Optional validity column. Defaults to |
min_ibi |
Minimum plausible IBI in seconds. |
max_ibi |
Maximum plausible IBI in seconds. |
A data frame with one row per window and IBI-derived HRV summaries.
Computes descriptive IBI/RR interval and simple HRV-style window summaries
from genuine inter-beat interval data. The function does not use raw HRV
columns as HRV metrics. It calculates metrics such as mean IBI, mean
instantaneous heart rate, SDNN, RMSSD, pNN20, and pNN50 only from valid IBI/RR
intervals.
summarise_gazepoint_ibi_windows( data, ibi_col = NULL, group_cols = NULL, time_col = NULL, unit = c("auto", "milliseconds", "seconds"), min_ibi_ms = 300, max_ibi_ms = 2000, max_jump_ms = 500, exclude_large_jumps = TRUE, min_valid_ibi = 2L )summarise_gazepoint_ibi_windows( data, ibi_col = NULL, group_cols = NULL, time_col = NULL, unit = c("auto", "milliseconds", "seconds"), min_ibi_ms = 300, max_ibi_ms = 2000, max_jump_ms = 500, exclude_large_jumps = TRUE, min_valid_ibi = 2L )
data |
A data frame. |
ibi_col |
Optional IBI/RR interval column. If |
group_cols |
Optional grouping columns defining windows, such as participant, trial, stimulus, condition, or window labels. |
time_col |
Optional time/order column used to order IBI values before successive-difference metrics are computed. |
unit |
Unit of the IBI values. |
min_ibi_ms |
Minimum plausible IBI in milliseconds. |
max_ibi_ms |
Maximum plausible IBI in milliseconds. |
max_jump_ms |
Maximum plausible absolute change between successive IBI values within a group. |
exclude_large_jumps |
Logical. Should intervals flagged as large jumps be excluded from the window summaries? |
min_valid_ibi |
Minimum valid IBI count required for a window to be marked as sufficient. |
A list with overview, windows, samples, and settings.
df <- data.frame( USER = rep(c("P1", "P2"), each = 4), IBI = c(800, 810, 790, 805, 900, 910, 905, 920) ) summarise_gazepoint_ibi_windows(df, group_cols = "USER")df <- data.frame( USER = rep(c("P1", "P2"), each = 4), IBI = c(800, 810, 790, 805, 900, 910, 905, 920) ) summarise_gazepoint_ibi_windows(df, group_cols = "USER")
Creates a combined window-level summary table for GSR/EDA, heart rate, and
engagement dial. The output is suitable for later merging with eye-tracking
summaries from gp3tools.
summarise_gazepoint_multimodal_windows( data, group_columns = NULL, exclude_zero = TRUE )summarise_gazepoint_multimodal_windows( data, group_columns = NULL, exclude_zero = TRUE )
data |
A data frame or a path to a Gazepoint CSV export. |
group_columns |
Optional grouping columns defining windows, such as
|
exclude_zero |
Should zero values be excluded from GSR and heart-rate summaries? |
A data frame with one row per window and prefixed biometric summary columns.
Creates one row per event or TTL marker and links detected SCR peaks to event-relative analysis and response windows. The helper is intended to produce transparent event-level EDA/SCR features for downstream mixed models, hurdle models, and reporting.
summarise_gazepoint_scr_event_windows( data = NULL, scr_peaks, events = NULL, time_col = NULL, event_time_col = NULL, event_id_col = NULL, event_label_col = NULL, group_cols = NULL, ttl_cols = NULL, ttl_valid_col = NULL, event_detection = c("rising", "active"), analysis_window = c(0, 6), response_window = c(1, 4), amplitude_col = "amplitude", peak_time_col = "peak_time", onset_time_col = "onset_time", rise_time_col = "rise_time", recovery_time_col = "recovery_time_after_peak", peak_status_col = "status", peak_selection = c("largest_amplitude", "first_peak"), collapse_simultaneous_events = FALSE )summarise_gazepoint_scr_event_windows( data = NULL, scr_peaks, events = NULL, time_col = NULL, event_time_col = NULL, event_id_col = NULL, event_label_col = NULL, group_cols = NULL, ttl_cols = NULL, ttl_valid_col = NULL, event_detection = c("rising", "active"), analysis_window = c(0, 6), response_window = c(1, 4), amplitude_col = "amplitude", peak_time_col = "peak_time", onset_time_col = "onset_time", rise_time_col = "rise_time", recovery_time_col = "recovery_time_after_peak", peak_status_col = "status", peak_selection = c("largest_amplitude", "first_peak"), collapse_simultaneous_events = FALSE )
data |
Optional Gazepoint biometric data frame. Required when |
scr_peaks |
A |
events |
Optional event data frame. If |
time_col |
Optional time/counter column in |
event_time_col |
Optional event-time column in |
event_id_col |
Optional event identifier column in |
event_label_col |
Optional event label/condition column in |
group_cols |
Optional grouping columns used to match events and peaks. |
ttl_cols |
Optional TTL marker columns used when |
ttl_valid_col |
Optional TTL validity column. If supplied, TTL-derived events require this column to be non-zero. |
event_detection |
Event-detection rule for TTL columns. |
analysis_window |
Numeric length-two vector giving the event-relative
analysis window in the same units as |
response_window |
Numeric length-two vector giving the event-relative response window used for the binary SCR response flag. |
amplitude_col |
Column in the peak table containing SCR amplitude. |
peak_time_col |
Column in the peak table containing peak time. |
onset_time_col |
Column in the peak table containing onset time. |
rise_time_col |
Column in the peak table containing SCR rise time. |
recovery_time_col |
Column in the peak table containing recovery time after peak. |
peak_status_col |
Column in the peak table containing peak status. |
peak_selection |
How to choose one peak when several peaks fall in the
response window. |
collapse_simultaneous_events |
Logical. If |
A list with overview, event_table, window_qc, events,
peaks, and settings.
Computes AOI dwell time, entry counts, first-entry latency, and valid-sample ratios from gaze samples or fixation/AOI tables.
summarize_gazepoint_aoi_dwell( data, time_col = NULL, aoi_col = NULL, duration_col = NULL, group_cols = NULL, valid_col = NULL )summarize_gazepoint_aoi_dwell( data, time_col = NULL, aoi_col = NULL, duration_col = NULL, group_cols = NULL, valid_col = NULL )
data |
Data frame containing AOI labels. |
time_col |
Optional time column for sample-level data. |
aoi_col |
AOI column. |
duration_col |
Optional duration column for fixation-level data. |
group_cols |
Optional grouping columns such as participant/trial. |
valid_col |
Optional validity column. |
Data frame with one row per group and AOI.
Summarizes pass, warning, failure, not-checked, recorded, and other status counts from a Gazepoint audit index. The summary is descriptive only and is intended to support transparent reporting of audit outputs.
summarize_gazepoint_audit_trail(audit_index, by = NULL)summarize_gazepoint_audit_trail(audit_index, by = NULL)
audit_index |
A |
by |
Optional character vector of grouping columns in |
A data frame with class gazepoint_audit_trail_summary.
Summarizes the correction log returned by correct_gazepoint_beats().
The summary is intended for transparent reporting and does not imply automatic
exclusion or interpretive conclusions.
summarize_gazepoint_beat_corrections(correction, by = NULL)summarize_gazepoint_beat_corrections(correction, by = NULL)
correction |
A |
by |
Optional character vector of grouping columns. |
A data frame.
Creates event-locked sample windows and trial-level summary metrics for one or more numeric Gazepoint modalities such as EDA, PPG, HR, IBI, pupil, gaze, or derived signals.
summarize_gazepoint_eventlocked_multimodal( data, events, time_col = NULL, event_time_col = NULL, event_id_col = NULL, group_cols = NULL, signal_cols = NULL, pre_s = 1, post_s = 3, baseline_window_s = c(-1, 0), summary_window_s = c(0, 3) )summarize_gazepoint_eventlocked_multimodal( data, events, time_col = NULL, event_time_col = NULL, event_id_col = NULL, group_cols = NULL, signal_cols = NULL, pre_s = 1, post_s = 3, baseline_window_s = c(-1, 0), summary_window_s = c(0, 3) )
data |
Data frame or named list of data frames. |
events |
Event table or numeric event times. |
time_col |
Optional time column for data-frame input. |
event_time_col |
Optional event-time column. |
event_id_col |
Optional event identifier column. |
group_cols |
Optional grouping columns used to match events to samples. |
signal_cols |
Optional character vector, or named list for list input. |
pre_s |
Seconds before each event. |
post_s |
Seconds after each event. |
baseline_window_s |
Two-element baseline window relative to event. |
summary_window_s |
Two-element summary window relative to event. |
Object of class gazepoint_eventlocked_multimodal.
Creates a descriptive file inventory for a Gazepoint export folder or a vector of files. The function summarizes paths, extensions, file sizes, likely export types, and empty-file flags. It is intended for reproducibility and audit reporting only.
summarize_gazepoint_export_inventory( path, recursive = TRUE, include_hidden = FALSE, classify = TRUE )summarize_gazepoint_export_inventory( path, recursive = TRUE, include_hidden = FALSE, classify = TRUE )
path |
Directory path, file path, or character vector of file paths. |
recursive |
Logical. If |
|
Logical. If |
|
classify |
Logical. If |
A data frame with class gazepoint_export_inventory.
Creates a descriptive feature-coverage table from exported function names. Domains are assigned using transparent name patterns. The summary is intended for release review and documentation planning only.
summarize_gazepoint_feature_coverage( path = ".", exports = NULL, patterns = NULL )summarize_gazepoint_feature_coverage( path = ".", exports = NULL, patterns = NULL )
path |
Package root. |
exports |
Optional character vector of exported functions. If |
patterns |
Optional named list of regular-expression patterns used to assign exported functions to domains. |
A data frame with one row per domain.
Computes fixation-level summary metrics by participant, trial, AOI, or any user-specified grouping columns.
summarize_gazepoint_fixations( fixDF, duration_col = NULL, x_col = NULL, y_col = NULL, participant_col = NULL, trial_col = NULL, aoi_col = NULL, group_cols = NULL, duration_unit = c("auto", "seconds", "milliseconds") )summarize_gazepoint_fixations( fixDF, duration_col = NULL, x_col = NULL, y_col = NULL, participant_col = NULL, trial_col = NULL, aoi_col = NULL, group_cols = NULL, duration_unit = c("auto", "seconds", "milliseconds") )
fixDF |
Fixation data frame. |
duration_col |
Fixation duration column. If NULL, common Gazepoint
names such as |
x_col |
Fixation x-coordinate column. |
y_col |
Fixation y-coordinate column. |
participant_col |
Optional participant column. |
trial_col |
Optional trial column. |
aoi_col |
Optional AOI column. |
group_cols |
Optional grouping columns. Overrides detected participant, trial, and AOI columns. |
duration_unit |
|
Data frame with fixation count, duration, and dispersion metrics.
fix <- data.frame(trial = "T1", AOI = c("A", "A"), FPOGD = c(.2, .3), FPOGX = c(.1, .2), FPOGY = c(.3, .4)) summarize_gazepoint_fixations(fix)fix <- data.frame(trial = "T1", AOI = c("A", "A"), FPOGD = c(.2, .3), FPOGX = c(.1, .2), FPOGY = c(.3, .4)) summarize_gazepoint_fixations(fix)
American-spelling alias for fixation summaries by AOI
summarize_gazepoint_fixations_by_aoi(...)summarize_gazepoint_fixations_by_aoi(...)
... |
Arguments passed to |
A data frame of class "gazepoint_fixation_aoi_summary".
Computes missingness rates, missing-run counts, longest missing run, longest missing duration, and optional long-gap counts for one or more columns. This is intended as a reviewer-friendly audit helper before interpolation, exclusion, or event-locked analysis.
summarize_gazepoint_missingness( data, signal_cols = NULL, time_col = NULL, group_cols = NULL, long_gap_s = NULL, count_nonfinite = TRUE )summarize_gazepoint_missingness( data, signal_cols = NULL, time_col = NULL, group_cols = NULL, long_gap_s = NULL, count_nonfinite = TRUE )
data |
Data frame containing signal columns. |
signal_cols |
Optional character vector of columns to audit. If omitted,
all columns except |
time_col |
Optional time column. If supplied or detected, missing-run durations are reported in seconds. |
group_cols |
Optional grouping columns such as participant, session, or trial. |
long_gap_s |
Optional threshold in seconds used to count long missing gaps. |
count_nonfinite |
If TRUE, non-finite numeric values are counted as missing. |
Data frame with one row per group and signal column.
Aggregates the summary table returned by detect_gazepoint_nonwear().
The result is intended for QC reporting and does not imply automatic
exclusion.
summarize_gazepoint_nonwear(nonwear, by = "signal")summarize_gazepoint_nonwear(nonwear, by = "signal")
nonwear |
A |
by |
Character vector of columns used for aggregation. |
A data frame.
Summarizes checklist or audit results into compact readiness counts and proportions. The summary is intended for reporting and reviewer-readiness documentation.
summarize_gazepoint_preregistration_readiness(audit, by = NULL)summarize_gazepoint_preregistration_readiness(audit, by = NULL)
audit |
A |
by |
Optional grouping column, such as |
A data frame with class gazepoint_preregistration_readiness.
Computes event-level baseline-corrected pupil metrics, including peak dilation, peak latency, mean response, and area under the curve.
summarize_gazepoint_pupil_events( data, events, pre = 1, post = 3, time_col = NULL, pupil_col = NULL, event_time_col = NULL, event_id_col = NULL, baseline_window = NULL, response_window = c(0, 3) )summarize_gazepoint_pupil_events( data, events, pre = 1, post = 3, time_col = NULL, pupil_col = NULL, event_time_col = NULL, event_id_col = NULL, baseline_window = NULL, response_window = c(0, 3) )
data |
Pupil data frame. |
events |
Event timestamps, event data frame, or event-log path. |
pre |
Seconds before event onset. |
post |
Seconds after event onset. |
time_col |
Time column. |
pupil_col |
Pupil column. |
event_time_col |
Event-time column in |
event_id_col |
Event identifier column in |
baseline_window |
Baseline window relative to event onset. |
response_window |
Response window relative to event onset. |
Data frame with one row per event.
Creates a compact QC overview table from row-level or session-level QC data. The summary can include counts of flags, mean/minimum quality index values, and simple descriptive summaries for selected metrics.
summarize_gazepoint_qc_overview( data, group_cols = NULL, quality_index_col = NULL, flag_cols = NULL, metric_cols = NULL )summarize_gazepoint_qc_overview( data, group_cols = NULL, quality_index_col = NULL, flag_cols = NULL, metric_cols = NULL )
data |
A data frame. |
group_cols |
Optional grouping columns. |
quality_index_col |
Optional numeric quality-index column. |
flag_cols |
Optional logical flag columns. If |
metric_cols |
Optional numeric metric columns to summarize. |
A data frame with class gazepoint_qc_overview.
Computes simple gaze/fixation-path summaries including path length, saccade count, regression-like leftward movements, fixation count, AOI transitions, and transition entropy.
summarize_gazepoint_scanpath_metrics( data, x_col = NULL, y_col = NULL, time_col = NULL, aoi_col = NULL, fixation_id_col = NULL, group_cols = NULL, min_saccade_distance = 0.02 )summarize_gazepoint_scanpath_metrics( data, x_col = NULL, y_col = NULL, time_col = NULL, aoi_col = NULL, fixation_id_col = NULL, group_cols = NULL, min_saccade_distance = 0.02 )
data |
Gaze or fixation data frame. |
x_col |
Gaze/fixation x column. |
y_col |
Gaze/fixation y column. |
time_col |
Optional time column. |
aoi_col |
Optional AOI column. |
fixation_id_col |
Optional fixation identifier column. |
group_cols |
Optional grouping columns. |
min_saccade_distance |
Minimum Euclidean movement counted as saccade. |
Data frame with one row per group.
Computes event-level baseline, peak amplitude, peak latency, recovery latency, and post-peak recovery slope from EDA/GSR data.
summarize_gazepoint_scr_recovery( data, events, pre = 1, post = 6, time_col = NULL, signal_col = NULL, event_time_col = NULL, event_id_col = NULL, baseline_window = NULL, peak_window = c(0.5, 4), recovery_fraction = 0.5 )summarize_gazepoint_scr_recovery( data, events, pre = 1, post = 6, time_col = NULL, signal_col = NULL, event_time_col = NULL, event_id_col = NULL, baseline_window = NULL, peak_window = c(0.5, 4), recovery_fraction = 0.5 )
data |
EDA/GSR data frame. |
events |
Event timestamps, event data frame, or event-log path. |
pre |
Seconds before event onset. |
post |
Seconds after event onset. |
time_col |
Time column in |
signal_col |
EDA/GSR signal column. |
event_time_col |
Event-time column in |
event_id_col |
Event identifier column in |
baseline_window |
Baseline window relative to event onset. |
peak_window |
Peak-search window relative to event onset. |
recovery_fraction |
Fraction of peak amplitude used as recovery target. |
Data frame with one row per event.
Summarizes signal-quality rows by user-selected columns. The result is a reporting table and does not imply automatic exclusion or interpretation.
summarize_gazepoint_signal_quality(quality, by = "signal")summarize_gazepoint_signal_quality(quality, by = "signal")
quality |
A data frame returned by
|
by |
Character vector of grouping columns. Defaults to |
A data frame.
Returns a compact cluster-level summary table from a
gazepoint_cluster_permutation object.
summarize_gazepoint_time_clusters(x, alpha = NULL)summarize_gazepoint_time_clusters(x, alpha = NULL)
x |
Object returned by |
alpha |
Optional cluster-level alpha. If |
A data frame.
Computes valid-pupil, valid-gaze, and combined tracking ratios overall or by participant/trial/group.
summarize_gazepoint_tracking( data, pupil_cols = NULL, x_col = NULL, y_col = NULL, group_cols = NULL, screen_bounds = c(0, 1, 0, 1), nonpositive_is_invalid = TRUE )summarize_gazepoint_tracking( data, pupil_cols = NULL, x_col = NULL, y_col = NULL, group_cols = NULL, screen_bounds = c(0, 1, 0, 1), nonpositive_is_invalid = TRUE )
data |
Eye-tracking data frame. |
pupil_cols |
Optional pupil columns. |
x_col |
Optional gaze x column. |
y_col |
Optional gaze y column. |
group_cols |
Optional grouping columns. |
screen_bounds |
Numeric vector |
nonpositive_is_invalid |
If TRUE, non-positive pupil values are invalid. |
Data frame of tracking ratios by group.
Joins Gazepoint Biometrics data to gaze or fixation data using exact key columns. This function is intentionally conservative: it does not perform interpolation, nearest-neighbour matching, or automatic time shifting. For a first reproducible workflow, exact joins by participant, media, trial, sample counter, or fixation identifier are preferred when those fields are available.
sync_gazepoint_biometrics_with_gaze( biometrics, gaze, by, all_x = TRUE, suffixes = c(".gaze", ".bio") )sync_gazepoint_biometrics_with_gaze( biometrics, gaze, by, all_x = TRUE, suffixes = c(".gaze", ".bio") )
biometrics |
A Gazepoint Biometrics data frame. |
gaze |
A gaze, fixation, AOI, or |
by |
Character vector of key columns used for joining. |
all_x |
Logical. Should all rows from |
suffixes |
Character vector of length two used for duplicate non-key column names. |
A data frame with gaze rows joined to biometric columns. The returned
object has class "gazepoint_biometrics_sync" and a "sync_summary"
attribute.
Applies explicit clock offsets and known latency corrections to already
imported LSL/XDF streams. Input may be named data frames or pyxdf-style
stream lists containing time_stamps and time_series.
sync_gazepoint_signals_via_lsl( streams, reference = NULL, time_cols = NULL, clock_offsets_s = NULL, known_lags_s = NULL, relative_zero = c("reference", "global", "none"), dejitter = c("none", "linear"), nominal_rates_hz = NULL, merge = c("none", "nearest"), tolerance_s = NULL )sync_gazepoint_signals_via_lsl( streams, reference = NULL, time_cols = NULL, clock_offsets_s = NULL, known_lags_s = NULL, relative_zero = c("reference", "global", "none"), dejitter = c("none", "linear"), nominal_rates_hz = NULL, merge = c("none", "nearest"), tolerance_s = NULL )
streams |
Named list of imported streams. |
reference |
Name of the reference stream. |
time_cols |
Optional named time-column vector or list. |
clock_offsets_s |
Values added to stream timestamps to place them in the reference clock domain. |
known_lags_s |
Known acquisition latencies subtracted from timestamps. |
relative_zero |
Origin for relative synchronized time. |
dejitter |
Optional transparent linear timestamp regularization. |
nominal_rates_hz |
Optional named nominal sampling frequencies. |
merge |
Whether to return separate streams or a nearest-neighbour merged table on the reference stream. |
tolerance_s |
Optional nearest-neighbour tolerance. |
A "gazepoint_lsl_sync" object.
Tests whether a nonlinear HRV statistic differs from surrogate RR/IBI sequences. This is a screening tool for evidence inconsistent with a simple linear stochastic null process. It does not prove deterministic chaos or diagnose any condition.
test_gazepoint_hrv_nonlinearity( dat, ibi_col = "IBI", group_cols = NULL, metric = c("sample_entropy", "approximate_entropy", "sd1_sd2_ratio"), n_surrogates = 99, surrogate_method = c("phase_randomized", "shuffle"), m = 2, r_multiplier = 0.2, statistic_fun = NULL, seed = NULL )test_gazepoint_hrv_nonlinearity( dat, ibi_col = "IBI", group_cols = NULL, metric = c("sample_entropy", "approximate_entropy", "sd1_sd2_ratio"), n_surrogates = 99, surrogate_method = c("phase_randomized", "shuffle"), m = 2, r_multiplier = 0.2, statistic_fun = NULL, seed = NULL )
dat |
A data frame containing IBI/RR intervals. |
ibi_col |
Numeric IBI/RR interval column. |
group_cols |
Optional grouping columns. |
metric |
Nonlinear statistic to test. |
n_surrogates |
Number of surrogate series per group. |
surrogate_method |
|
m |
Embedding dimension for entropy metrics. |
r_multiplier |
Tolerance multiplier for entropy metrics. |
statistic_fun |
Optional custom statistic function accepting numeric x. |
seed |
Optional random seed. |
A list with overview, results, surrogate_statistics, and
settings.
Trim Gazepoint biometrics data PsPM-style
trim_gazepoint_biometrics_pspm_style( data, start_s = NULL, end_s = NULL, time_col = NULL, reset_time = FALSE )trim_gazepoint_biometrics_pspm_style( data, start_s = NULL, end_s = NULL, time_col = NULL, reset_time = FALSE )
data |
Gazepoint data frame. |
start_s |
Start time in seconds. |
end_s |
End time in seconds. |
time_col |
Time column. |
reset_time |
If TRUE, reset trimmed time to start at zero. |
Trimmed data frame.
Uses stats::approx() to interpolate selected numeric signals onto a
regular time grid within each group. The function records an interpolation
log and does not extrapolate beyond the observed time range.
upsample_gazepoint_data( data, time_col, signal_cols = NULL, group_cols = NULL, interval = NULL, method = c("linear", "constant") )upsample_gazepoint_data( data, time_col, signal_cols = NULL, group_cols = NULL, interval = NULL, method = c("linear", "constant") )
data |
A data frame. |
time_col |
Numeric time column. |
signal_cols |
Optional character vector of numeric signal columns. If
|
group_cols |
Optional grouping columns. |
interval |
Numeric interval for the output time grid, in the same units
as |
method |
Interpolation method passed to |
A data frame with class gazepoint_upsampled_data.
Performs a conservative validation of a Gazepoint Biometrics table or CSV file. The function checks whether known biometric columns are present, whether biometric channels appear active, whether common time/synchronisation columns are available, and whether obvious structural issues are present.
validate_gazepoint_biometrics(data, require_active_signal = FALSE)validate_gazepoint_biometrics(data, require_active_signal = FALSE)
data |
A data frame or a path to a Gazepoint CSV export. |
require_active_signal |
Logical. If |
A list with overview, columns, active_channels, and issues.
The returned object has class "gazepoint_biometrics_validation".
Lightweight format validator for Gazepoint-style biometric exports. This wrapper checks required and optional columns and, when available, attaches schema and audit outputs from existing package helpers.
validate_gazepoint_format( data, required_cols = NULL, optional_cols = NULL, expected_modalities = NULL, standardize = FALSE, strict = FALSE, ... )validate_gazepoint_format( data, required_cols = NULL, optional_cols = NULL, expected_modalities = NULL, standardize = FALSE, strict = FALSE, ... )
data |
Data frame to validate. |
required_cols |
Required column names. |
optional_cols |
Optional column names to report as present or absent. |
expected_modalities |
Optional expected modalities passed to
|
standardize |
If TRUE, standardize column names before validation. |
strict |
If TRUE, audit warnings make the returned |
... |
Reserved for future extensions. |
Object of class gazepoint_format_validation.
Consolidates coordinate, validity, missingness, timestamp, sampling, and large-gap checks for sample-level Gazepoint gaze data.
validate_gazepoint_gaze( data, time_col = NULL, x_col = NULL, y_col = NULL, validity_cols = NULL, group_cols = NULL, coordinate_system = c("auto", "normalized", "pixels", "degrees"), screen_width_px = NULL, screen_height_px = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, expected_sampling_rate_hz = NULL, sampling_tolerance = 0.2, missing_threshold = 0.2, gap_multiplier = 3 )validate_gazepoint_gaze( data, time_col = NULL, x_col = NULL, y_col = NULL, validity_cols = NULL, group_cols = NULL, coordinate_system = c("auto", "normalized", "pixels", "degrees"), screen_width_px = NULL, screen_height_px = NULL, time_unit = c("auto", "seconds", "milliseconds", "samples"), sampling_rate_hz = NULL, expected_sampling_rate_hz = NULL, sampling_tolerance = 0.2, missing_threshold = 0.2, gap_multiplier = 3 )
data |
A sample-level data frame. |
time_col |
Time column. If |
x_col |
Horizontal gaze-coordinate column. |
y_col |
Vertical gaze-coordinate column. |
validity_cols |
Optional validity columns. Logical values and positive numeric values are treated as valid. |
group_cols |
Optional grouping columns, such as participant and trial. |
coordinate_system |
Coordinate system: |
screen_width_px, screen_height_px
|
Screen dimensions required for bounded pixel-coordinate checks. |
time_unit |
Time unit: |
sampling_rate_hz |
Sampling rate required for sample-index time. |
expected_sampling_rate_hz |
Optional expected sampling rate. |
sampling_tolerance |
Relative tolerance around the expected sampling interval. |
missing_threshold |
Maximum acceptable missing-gaze proportion. |
gap_multiplier |
A gap is flagged when it exceeds this multiple of the expected or median interval. |
A "gazepoint_gaze_validation" object containing row-level flags,
group summaries, checks, an overall summary, and resolved settings.
Performs transparent metadata checks for Gazepoint workflow data frames. The function checks required columns, optional expected columns, missing IDs, duplicate key rows, and time ordering within groups. It returns a structured report rather than modifying the data.
validate_gazepoint_metadata( data, required_cols = character(), expected_cols = character(), id_cols = NULL, time_col = NULL, unique_cols = NULL, allow_missing_ids = FALSE )validate_gazepoint_metadata( data, required_cols = character(), expected_cols = character(), id_cols = NULL, time_col = NULL, unique_cols = NULL, allow_missing_ids = FALSE )
data |
A data frame. |
required_cols |
Character vector of required columns. |
expected_cols |
Optional character vector of expected but non-fatal columns. |
id_cols |
Optional character vector naming participant/session/trial identifiers. |
time_col |
Optional time column used for ordering checks. |
unique_cols |
Optional character vector defining a row-level key that should be unique. |
allow_missing_ids |
Logical. If |
A list containing status, problems, warnings, and a summary table. The
object has class "gazepoint_metadata_validation".
d <- data.frame( participant = c("P01", "P01"), time = c(1, 2), pupil_left = c(3.1, 3.2) ) validate_gazepoint_metadata( d, required_cols = c("participant", "time"), id_cols = "participant", time_col = "time" )d <- data.frame( participant = c("P01", "P01"), time = c(1, 2), pupil_left = c(3.1, 3.2) ) validate_gazepoint_metadata( d, required_cols = c("participant", "time"), id_cols = "participant", time_col = "time" )
Writes report-ready Gazepoint Biometrics tables to CSV files. The input can
be a workflow object produced by run_gazepoint_biometrics_workflow(), a
report-table object produced by create_gazepoint_biometrics_report_tables(),
or a named list of data frames.
write_gazepoint_biometrics_report_tables( tables, output_dir, prefix = "gazepoint_biometrics", overwrite = TRUE, include_empty_message_tables = FALSE )write_gazepoint_biometrics_report_tables( tables, output_dir, prefix = "gazepoint_biometrics", overwrite = TRUE, include_empty_message_tables = FALSE )
tables |
A Gazepoint Biometrics workflow object, report-table object, or named list of data frames. |
output_dir |
Output directory for CSV files. |
prefix |
Filename prefix. |
overwrite |
Should existing files be overwritten? |
include_empty_message_tables |
Should placeholder tables containing only
a |
A data frame indexing written and skipped files.
Write a decision log to CSV, optionally with a compact text summary.
write_gazepoint_decision_log(log, path, summary_path = NULL, overwrite = FALSE)write_gazepoint_decision_log(log, path, summary_path = NULL, overwrite = FALSE)
log |
A decision log created with
|
path |
Output CSV file path. |
summary_path |
Optional output path for a text summary. If |
overwrite |
Logical. If |
A data frame listing written files.
Export profile tables and a compact text summary.
write_gazepoint_export_profile( profile, path, prefix = "gazepoint_export_profile", overwrite = FALSE )write_gazepoint_export_profile( profile, path, prefix = "gazepoint_export_profile", overwrite = FALSE )
profile |
Object returned by |
path |
Output folder. |
prefix |
File prefix. |
overwrite |
Logical. If |
A data frame listing written files.
Writes only machine-readable aggregate compatibility information. No source data, participant identifiers, input filenames, or local data paths are included.
write_gazepoint_interoperability_audit( x, output_dir, prefix = "gpbiometrics-interoperability", overwrite = FALSE )write_gazepoint_interoperability_audit( x, output_dir, prefix = "gpbiometrics-interoperability", overwrite = FALSE )
x |
Object returned by
|
output_dir |
Output directory. |
prefix |
Filename prefix. |
overwrite |
Logical. Permit replacement of existing files. |
Invisibly returns a named character vector containing the four written file paths.
audit <- audit_gazepoint_interoperability_versions( include_python = FALSE ) output <- tempfile("gpbiometrics-interoperability-") files <- write_gazepoint_interoperability_audit( audit, output ) basename(files)audit <- audit_gazepoint_interoperability_versions( include_python = FALSE ) output <- tempfile("gpbiometrics-interoperability-") files <- write_gazepoint_interoperability_audit( audit, output ) basename(files)
Uses an external Python installation containing numpy and mne. Python is
invoked only when execute = TRUE; no Python package is an R dependency.
write_gazepoint_mne_fif( x, fname, events = NULL, overwrite = FALSE, fmt = c("single", "double"), python = NULL, execute = TRUE, keep_intermediate = FALSE, verbose = FALSE, ... )write_gazepoint_mne_fif( x, fname, events = NULL, overwrite = FALSE, fmt = c("single", "double"), python = NULL, execute = TRUE, keep_intermediate = FALSE, verbose = FALSE, ... )
x |
A |
fname |
Output filename. Use an MNE-compatible suffix such as
|
events |
Optional |
overwrite |
Overwrite an existing file. |
fmt |
FIF numeric format: |
python |
Optional Python executable or Windows |
execute |
If |
keep_intermediate |
Retain temporary CSV, TSV, and Python files. |
verbose |
Show Python/MNE output. |
... |
Arguments passed to |
A "gazepoint_mne_fif_export" object.
Writes only aggregate dataset summaries, sanitized condition information, runtime metadata, and non-sensitive settings.
write_gazepoint_real_data_smoke( x, output_dir, prefix = "gpbiometrics-real-data-smoke", overwrite = FALSE, protect_repository = TRUE )write_gazepoint_real_data_smoke( x, output_dir, prefix = "gpbiometrics-real-data-smoke", overwrite = FALSE, protect_repository = TRUE )
x |
Object returned by |
output_dir |
External output directory. |
prefix |
Output filename prefix. |
overwrite |
Permit replacement of existing files? |
protect_repository |
Reject output directories inside the current package repository? |
Invisibly returns a named character vector of written files.