fixation_plot_temporal: Plot fixation classified vs. raw gaze coordinates

View source: R/VisualizationFunctions.R

fixation_plot_temporalR Documentation

Plot fixation classified vs. raw gaze coordinates

Description

This function plots and returns a ggplot2 figure showing two time series of gaze coordinates plotted against time. The interval to plot can be defined as a proportion of the data frame, by timestamps, or by sample numbers. Use this function to plot data before and after processing or filtering to examine their effects. For example, unprocessed x or y coordinates can be plotted against x and y coordinates following pre-processing and/or event detection with a fixation detection algorithm Either the x or the y vector is plotted

Usage

fixation_plot_temporal(
  data_in,
  plot.window = c(NA, NA),
  var1 = "x.raw",
  var2 = "x",
  x.index.var = "sample.index",
  verbose = TRUE
)

Arguments

data_in

gaze matrix which must include columns for filtered and unfiltered data as specified in the var1 and var2 paramters

plot.window

vector defining the time window to plot. If left empty, the 50-65 <0, they are assumed to be proportions, e.g., plot.window = c(0.3,0.35) plots the 30-35 in the data found in the variable 'timestamp'

var1

Name of the first variable to plot. Default "x.raw"

var2

Name of the second variable to plot (overlayed on var1) Default: "x"

x.index.var

Name of the variable to plot on the X axis, for example timestamp or sample index. If the default setting is used, gaze coordinates are plotted against sample number in the selected data interval.

verbose

If TRUE, print the resulting plot

Value

a ggplot with gaze coordinates plotted on the y axis and sample number on the x axis

Examples

new.plot <- fixation_plot_temporal(sample.data.classified, plot.window = c(1000, 2000))

kollaR documentation built on June 8, 2025, 10:03 a.m.