Package 'fpa'

Title: Spatio-Temporal Fixation Pattern Analysis
Description: Spatio-temporal Fixation Pattern Analysis (FPA) is a new method of analyzing eye movement data, developed by Mr. Jinlu Cao under the supervision of Prof. Chen Hsuan-Chih at The Chinese University of Hong Kong, and Prof. Wang Suiping at the South China Normal Univeristy. The package "fpa" is a R implementation which makes FPA analysis much easier. There are four major functions in the package: ft2fp(), get_pattern(), plot_pattern(), and lineplot(). The function ft2fp() is the core function, which can complete all the preprocessing within moments. The other three functions are supportive functions which visualize the eye fixation patterns.
Authors: Jinlu Cao
Maintainer: Jinlu Cao <[email protected]>
License: GPL-2
Version: 1.0
Built: 2024-11-13 03:12:20 UTC
Source: https://github.com/cran/fpa

Help Index


Spatio-temporal Fixation Pattern Analysis

Description

"Spatio-temporal Fixation Pattern Analysis" (FPA) is a new method of analyzing eye movement data, developed by Mr. Jinlu Cao under the supervision of Prof. CHEN Hsuan-Chih at The Chinese Univeristy of Hong Kong, and Prof. Wang Suiping at The South China Normal Univeristy. The method provides a new way to inspect the spato-temporal fixation patterns of eye movements.

Details

Package: fpa
Type: Package
Version: 1.0
Date: 2016-08-13
License: GPL-2

The package "fpa" is a R implementation which makes FPA analysis much easier. There are four major functions in the package: ft2fp(), get_pattern(), plot_pattern(), and lineplot(). The function ft2fp() is the core function, which can complete all the preprocessing within seconds or minutes. The other three functions are supportive functions which visualize the eye fixation patterns.

Author(s)

Jinlu Cao

Maintainer: Jinlu Cao <[email protected]>

See Also

ft2fp, get_pattern, plot_pattern, lineplot

Examples

data(rawdata)
newdata <- ft2fp (rawdata, 4, 3000, 100)
pattern <- get_pattern(newdata)
plot_pattern(pattern)

Convert fixation time to fixation probability

Description

The ft2fp() function transforms the fixation time (start and end time for each fixation) data to fixation probability data. The function can finish all the preprocessing of using FPA to analyze eye movement data.

Usage

ft2fp(data,CriticalRegion,TimeCourse,Interval,norm=TRUE,rm.nr=FALSE,rm.1p=TRUE)

Arguments

data

the raw eye movement data provided by user. A data frame which contains variables of "List", "Subject", "Item", "Condition", "Region", "Fix_Start", and "Fix_End". The names and number of variables in your data should be exactly same with above.

CriticalRegion

the No. of region in which the researcher is interested. All fixation information before the first-pass on that region will be discarded for each trial.

TimeCourse

the time course to be analyzed after the first-pass of critical region. The unit is millisecond.

Interval

the time interval (or bin) to show in the time course of interest. The unit is millisecond, and the value should be smaller than the value for TimeCourse.

norm

to choose whether to normalize the fixation duration according to each subject's mean duration and general mean duration. If TRUE, the fixation durations are adjusted for each subject's reading rate. The default value if TRUE.

rm.nr

to choose whether to exclude the trials with no regression after the first-pass on critical region. The default value is FALSE.

rm.1p

to choose whether to exclude the fixations at the first pass (or Gaze duration) on critical region. The default value is TRUE.

Value

a data frame with the variables of "list", "subject", "condition", "region", "time", "fix_prob" (fixation probability), "y" (number of trials with fixation) and "N" (number of total valid trials).

Author(s)

Jinlu Cao

See Also

fpa

Examples

data(rawdata)
newdata <- ft2fp (rawdata, 4, 3000, 100)
newdata <- ft2fp (rawdata, 4, 3000, 100, norm=TRUE, rm.nr=TRUE, rm.1p=FALSE)

Get the general fixation pattern

Description

The get_pattern() function aggregates the data so that the general fixation pattern can be shown for each condition. Users should provide the data frame returned in ft2fp() function. Users can use the returned data frame of this function to make plots on the pattern by themselves, or use plot_pattern() and lineplot() functions.

Usage

get_pattern(data)

Arguments

data

is the data frame returned by the ft2fp function.

Value

a data frame which shows the averaged fixation probabilities for each spatio-temporal unit for each condition.

Author(s)

Jinlu Cao

See Also

ft2fp, plot_pattern, lineplot

Examples

data(newdata)
pattern <- get_pattern(newdata)

Plot the fixation probabilities for specific details

Description

The function lineplot() provides quick tools for plotting more detailed fixation probabilities for specific condition(s) and region(s). The function generates 2-dimensional line plots with "Time" as x, and "Fixation Probability" as y.

Usage

lineplot(data, Region = "All", Condition = "All")

Arguments

data

the data frame returned by get_pattern function.

Region

the intended region(s) to plot. It can be a string ("All"), a number (e.g., 1), or a vector (e.g., c(1,2)).

Condition

the intended condition(s) to plot. It can be a string ("All"), a number (e.g., 1), or a vector (e.g., c(1,2)).

Author(s)

Jinlu Cao

See Also

get_pattern, ft2fp, plot_pattern

Examples

data(pattern)
lineplot(pattern)
lineplot(pattern, Region="All", Condition=1)
lineplot(pattern, Condition=c(1,2))
lineplot(pattern, Region=2)
lineplot(pattern, Region=c(2,3), Condition=c(3,4,5))

Fixation probability data generated by ft2fp() function

Description

This data set is the fixation probability data generated by the ft2fp() function. The data set retains the information of list, subject, and condition of original fixation time data set. The variable "Time" is generated based on the TimeCourse and TimeInterval arguments defined by users. The variable "N" is the total number of valid trials after the deletion of invalid ones for the corresponding spatio-temporal unit. The variable "y" is the number of trials with fixations on that particular region at that time point. Fixation probability is calculated by dividing y by N. "N" and "y" would be used for further analysis in empirical logistic transformation and lme modeling.

Usage

data(newdata)

Format

In the data frame each row represents the fixation probability and other information for one spatio-temporal unit. The data frame has the following columns:

list

the id of the list

subject

the id of the subject

condition

the id of the condition

region

the id of the region

Time

the time after eyes leave critical region

N

total number of valid trials

y

number of trials with fixations

fix_prob

the fixation probability


Summary of fixation pattern generated by get_pattern() function

Description

This data set is generated by get_pattern() function, and describes the general fixation pattern for different conditions. The values under time variables are the aggregated fixation probabilities for each spatio-temporal unit. Users may use the data set to make plots of the pattern by themselves or use the dataset as argument of plot_pattern() and lineplot() functions.

Usage

data(pattern)

Format

The data set aggregates the fixation probability data, and show the general fixation pattern. The data frame has the following core columns:

condition

the id of the condition

region

the id of the region

0

averaged fixation probability at time 0

2500

averaged fixation probability at time 0


Plot the general fixation pattern

Description

The plot_pattern() function provides a quick tool to plot the fixation pattern for conditions. It generates 3-dimensional data, with x of "Time", y of "Region", and the colors representing the value of fixation probabilities.

Usage

plot_pattern(data, Condition = "All")

Arguments

data

the data frame returned by the get_pattern function.

Condition

the conditions which the user would like to plot. It can be a string ("All"), a number (e.g., 1), or a vector (e.g., c(1,2)). The default value is "All", meaning all conditions will be plotted.

Author(s)

Jinlu Cao

See Also

get_pattern, ft2fp

Examples

data(pattern)
plot_pattern(pattern)
plot_pattern(pattern, Condition=1)
plot_pattern(pattern, Condition=c(1,2))

Fixation time data of an eye movement experiment

Description

This data set is the eye movement data recorded during reading sentences. The sentences consists of 8 regions defined by the researcher. The experiment consists of 2 lists (8 items in each list), 2 subjects, and 4 conditions. Each row contains the information of one fixation. This data frame is a template for the data to be provided by users of fpa-package, and the number and names of variables should be same with this data frame. If the user does not have several lists in his/her experiment, lease use the id 1 for every row.

Usage

data(rawdata)

Format

In the data frame each row represents one fixation of the eyes. Fixations are ordered chronologically within trial. The data frame has the following columns:

List

the id of the list

Subject

the id of the subject

Condition

the id of the condition

Item

the id of the item

Region

the id of the region being fixed on

Fix_Start

the start time of the fixation

Fix_End

the end time of the fixation