filt_plot_2d: Plot fixation filtered vs. raw or unfiltered gaze coordinates...

View source: R/VisualizationFunctions.R

filt_plot_2dR Documentation

Plot fixation filtered vs. raw or unfiltered gaze coordinates in 2D space.

Description

This function plots and returns a ggplot2 figure showing fixation filtered and raw gaze coordinates plotted against time. The interval to plot can be defined as a proportion of the data frame or by sample numbers. This function uses one data.frame with fixations and one with sample-by-sample raw data

Usage

filt_plot_2d(
  raw.data,
  filtered.data,
  plot.window = c(NA, NA),
  raw.columns = c("x.raw", "y.raw"),
  filt.columns = c("x", "y"),
  fixation.radius = 40,
  xres = 1920,
  yres = 1080,
  verbose = TRUE
)

Arguments

raw.data

gaze matrix which must include columns for filtered and unfiltered data as specified in the raw.columns parameter

filtered.data

Data frame with fixation data which must include columns for filtered x and y data as specified in the raw.columns parameter as well as the variable onset which indicates the onset of the fixation. Make sure the onset varables match the timing in the raw.data df

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 percent of max.length interval of the data. Numbers >1 are assumed to refer to sample order in the data

raw.columns

Names of variable containing raw data. Default x.raw and y.raw

filt.columns

Names of variable containing filtered data. Default x and y

fixation.radius

Radius of circles showing fixations.

xres

horizontal resolution of the screen or area to plot on. Default 1920

yres

vertical resolution of the screen or area to plot on. Default 1080

verbose

if TRUE, print the resulting plot

Value

a ggplot of raw and fixated values plotted on the y axis and sample number on the x axis


kollaR documentation built on April 13, 2025, 5:11 p.m.