Overview

The mousetrap package provides functions for importing, preprocessing, analyzing, aggregating, and visualizing mouse-tracking data. A structured overview is given in the general package documentation which can be accessed through one of the following links.

mousetrap mousetrap-package

Process and analyze mouse-tracking data

Mousetrap functions

Below you find all mousetrap functions in alphabetical order.

mt_add_trajectory()

Add new trajectory to trajectory array.

mt_add_variables()

Add new variables to trajectory array.

mt_aggregate()

Aggregate mouse-tracking data per condition.

mt_aggregate_per_subject()

Aggregate mouse-tracking data per condition separately for each subject.

mt_align()

Align trajectories.

mt_align_start()

Align start position of trajectories.

mt_align_start_end()

Align start and end position of trajectories.

mt_angles()

Calculate movement angles.

mt_animate()

Create gif trajectory animation.

mt_average()

Average trajectories across intervals.

mt_bind()

Join two trajectory arrays

mt_check_bimodality()

Assess bimodality of mouse-tracking measure distributions.

mt_check_resolution()

Check logging resolution by looking at timestamp differences.

mt_cluster()

Cluster trajectories.

mt_cluster_k()

Estimate optimal number of clusters.

mt_count()

Count number of observations.

mt_derivatives()

Calculate distance, velocity, and acceleration.

mt_deviations()

Calculate deviations from idealized trajectory.

mt_diffmap()

Creates a difference-heatmap of two trajectory heatmap images.

mt_distmat()

Compute distance matrix.

mt_example

A mousetrap data object.

mt_example_raw

Raw mouse-tracking dataset for demonstrations of the mousetrap package

mt_exclude_finish()

Exclude phase without mouse movement at end of trial.

mt_exclude_initiation()

Exclude initial phase without mouse movement.

mt_export_long() mt_export_wide()

Export mouse-tracking data.

mt_heatmap()

Plot trajectory heatmap.

mt_heatmap_ggplot()

Plot trajectory heatmap using ggplot.

mt_heatmap_raw()

Creates high-resolution heatmap of trajectory data.

mt_import_long()

Import mouse-tracking data saved in long format.

mt_import_mousetrap()

Import mouse-tracking data recorded using the mousetrap plug-ins in OpenSesame.

mt_import_wide()

Import mouse-tracking data saved in wide format.

mt_length_normalize()

Length normalize trajectories.

mt_map()

Map trajectories to prototypes.

mt_measures()

Calculate mouse-tracking measures.

mt_plot() mt_plot_aggregate()

Plot trajectory data.

mt_plot_add_rect()

Add rectangles to trajectory plot.

mt_plot_per_trajectory()

Create PDF with separate plots per trajectory.

mt_plot_riverbed()

Plot density of mouse positions across time steps.

mt_prototypes

Mouse trajectory prototypes.

mt_qeffect()

Create quantile-effect plot

mt_remap_symmetric()

Remap mouse trajectories.

mt_resample()

Resample trajectories using a constant time interval.

mt_reshape()

General-purpose reshape and aggregation function for mousetrap data.

mt_sample_entropy()

Calculate sample entropy.

mt_scale_trajectories()

Standardize variables in mouse trajectory array.

mt_spatialize()

Spatialize trajectories.

mt_standardize()

Standardize mouse-tracking measures per level of other variables.

mt_subset()

Filter mousetrap data.

mt_time_normalize()

Time normalize trajectories.

print(<mt_heatmap_raw>)

Generic print for class mt_heatmap_raw

Helper functions

A number of additional helper functions are provided.

bezier()

Create Bezier-curves using the Bernstein approximation.

bimodality_coefficient()

Calculate bimodality coefficient.

scale_within()

Scale and center variables within the levels of another variable.

read_mt()

Read MouseTracker raw data.

Mouse-tracking datasets

Below you find all datasets included in the mousetrap package in alphabetical order.

KH2017

Mouse-tracking dataset from Kieslich & Henninger (2017)

KH2017_raw

Raw mouse-tracking dataset from Kieslich & Henninger (2017)

mt_example

A mousetrap data object.

mt_example_raw

Raw mouse-tracking dataset for demonstrations of the mousetrap package