Learn R Programming

mousetrap (version 2.0.0)

mt_movement_angle: Calculate initial movement angle.

Description

Calculate initial movement angle (IMA) and related measures for each trajectory.

Usage

mt_movement_angle(data, use = "trajectories", save_as = "measures", dimensions = c("xpos", "ypos"), timestamps = "timestamps", ima_percentile = 0.2, verbose = FALSE, show_progress = NULL)

Arguments

data
a mousetrap data object created using one of the mt_import functions (see mt_example for details). Alternatively, a trajectory array can be provided directly (in this case use will be ignored).
use
a character string specifying which trajectory data should be used.
save_as
a character string specifying where the calculated measures should be stored.
dimensions
a character vector specifying the two dimensions in the trajectory array that contain the mouse positions, the first value corresponding to the x-positions, the second to the y-positions.
timestamps
a character string specifying the trajectory dimension containing the timestamps.
ima_percentile
a decimal value. The initial movement angle will be calculated at the respective percentile .
verbose
logical indicating whether function should report its progress.
show_progress
Deprecated. Please use verbose instead.

Value

A mousetrap data object (see mt_example).If a data.frame with label specified in save_as (by default "measures") already exists, the IMA, IMA_time, and IMD values (see Details) are added as additional columns.If not, an additional data.frame will be added.If a trajectory array was provided directly as data, only the data.frame will be returned.

Details

The IMA is based on the initial movement angle used by Buetti and Kerzel (2009). In their experiment, actual hand movements were recorded and the IMA was the angle between the position of the hand and the axis running through the correct response location at a specific point in time (in the original study, one fifth of the trial). Adapting this to the mouse-tracking setup, the IMA is the angle between the idealized response trajectory (straight line) and the movement from the starting point in the trial to the position of the mouse at the specified percentile. If this position is above the idealized response trajectory, the angle has a positive value. If it is below the idealized response trajectory, the angle has a negative value.

The IMA is calculated for a specific percentile of the trial, which can be adjusted using ima_percentile (e.g., ima_percentile=0.2 to correspond to the study by Buetti and Kerzel, 2009). In addition, the timestamp of the specified percentile is also reported (IMA_time). Besides, the perpendicular deviation from the direct path at the specified percentile is included (IMD).

References

Buetti, S., & Kerzel, D. (2009). Conflicts during response selection affect response programming: Reactions toward the source of stimulation. Journal of Experimental Psychology: Human Perception and Performance, 35(3), 816-834.

See Also

mt_measures for calculating other mouse-tracking measures.

Examples

Run this code
mt_example <- mt_measures(mt_example)
mt_example <- mt_movement_angle(mt_example,
  use="trajectories", save_as="measures",
  ima_percentile=0.20)

Run the code above in your browser using DataLab