Package: mousetrap 3.2.3.9000

mousetrap: Process and Analyze Mouse-Tracking Data

Mouse-tracking, the analysis of mouse movements in computerized experiments, is a method that is becoming increasingly popular in the cognitive sciences. The mousetrap package offers functions for importing, preprocessing, analyzing, aggregating, and visualizing mouse-tracking data. An introduction into mouse-tracking analyses using mousetrap can be found in Wulff, Kieslich, Henninger, Haslbeck, & Schulte-Mecklenbeck (2025) <doi:10.3758/s13428-025-02695-2>.

Authors:Pascal J. Kieslich [aut, cre], Dirk U. Wulff [aut], Felix Henninger [aut], Jonas M. B. Haslbeck [aut], Sarah Brockhaus [ctb]

mousetrap_3.2.3.9000.tar.gz
mousetrap_3.2.3.9000.zip(r-4.7)mousetrap_3.2.3.9000.zip(r-4.6)mousetrap_3.2.3.9000.zip(r-4.5)
mousetrap_3.2.3.9000.tgz(r-4.6-x86_64)mousetrap_3.2.3.9000.tgz(r-4.6-arm64)mousetrap_3.2.3.9000.tgz(r-4.5-x86_64)mousetrap_3.2.3.9000.tgz(r-4.5-arm64)
mousetrap_3.2.3.9000.tar.gz(r-4.7-arm64)mousetrap_3.2.3.9000.tar.gz(r-4.7-x86_64)mousetrap_3.2.3.9000.tar.gz(r-4.6-arm64)mousetrap_3.2.3.9000.tar.gz(r-4.6-x86_64)
mousetrap_3.2.3.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
mousetrap/json (API)
NEWS

# Install 'mousetrap' in R:
install.packages('mousetrap', repos = c('https://pascalkieslich.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/pascalkieslich/mousetrap/issues

Pkgdown/docs site:https://pascalkieslich.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • KH2017 - Mouse-tracking dataset from Kieslich & Henninger
  • KH2017_raw - Raw mouse-tracking dataset from Kieslich & Henninger
  • mt_example - A mousetrap data object.
  • mt_example_raw - Raw mouse-tracking dataset for demonstrations of the mousetrap package
  • mt_prototypes - Mouse trajectory prototypes.

On CRAN:

Conda:

analysisclusteringmouse-trackingvisualizationcpp

6.60 score 54 stars 115 scripts 986 downloads 4 mentions 51 exports 44 dependencies

Last updated from:8dbae23ed7. Checks:12 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK232
linux-devel-x86_64OK160
source / vignettesOK314
linux-release-arm64OK184
linux-release-x86_64OK182
macos-release-arm64OK142
macos-release-x86_64OK357
macos-oldrel-arm64OK169
macos-oldrel-x86_64OK285
windows-develOK218
windows-releaseOK189
windows-oldrelFAIL41
wasm-releaseOK148

Exports:bezierbimodality_coefficientmt_add_trajectorymt_add_variablesmt_aggregatemt_aggregate_per_subjectmt_alignmt_align_startmt_align_start_endmt_anglesmt_animatemt_averagemt_bindmt_check_bimodalitymt_check_resolutionmt_clustermt_cluster_kmt_countmt_derivativesmt_deviationsmt_diffmapmt_distmatmt_exclude_finishmt_exclude_initiationmt_export_longmt_export_widemt_heatmapmt_heatmap_ggplotmt_heatmap_rawmt_import_longmt_import_mousetrapmt_import_widemt_length_normalizemt_mapmt_measuresmt_plotmt_plot_add_rectmt_plot_aggregatemt_plot_per_trajectorymt_plot_riverbedmt_remap_symmetricmt_resamplemt_reshapemt_sample_entropymt_scale_trajectoriesmt_spatializemt_standardizemt_subsetmt_time_normalizeread_mtscale_within

Dependencies:cliclustercpp11cstabdiptestdotCall64dplyrfarverfastclusterfieldsgenericsggplot2glueGPArotationgtableisobandlabelinglatticelifecyclemagrittrmapsmnormtnlmepillarpkgconfigpracmapsychpurrrR6RColorBrewerRcpprlangS7scalesspamstringistringrtibbletidyrtidyselectutf8vctrsviridisLitewithr

Readme and manuals

Help Manual

Help pageTopics
Create Bezier-curves using the Bernstein approximation.bezier
Calculate bimodality coefficient.bimodality_coefficient
Mouse-tracking dataset from Kieslich & Henninger (2017)KH2017
Raw mouse-tracking dataset from Kieslich & Henninger (2017)KH2017_raw
Add new trajectory to trajectory array.mt_add_trajectory
Add new variables to trajectory array.mt_add_variables
Aggregate mouse-tracking data per condition.mt_aggregate
Aggregate mouse-tracking data per condition separately for each subject.mt_aggregate_per_subject
Align trajectories.mt_align
Align start position of trajectories.mt_align_start
Align start and end position of trajectories.mt_align_start_end
Calculate movement angles.mt_angles
Create gif trajectory animation.mt_animate
Average trajectories across intervals.mt_average
Join two trajectory arraysmt_bind
Assess bimodality of mouse-tracking measure distributions.mt_check_bimodality
Check logging resolution by looking at timestamp differences.mt_check_resolution
Cluster trajectories.mt_cluster
Estimate optimal number of clusters.mt_cluster_k
Count number of observations.mt_count
Calculate distance, velocity, and acceleration.mt_derivatives
Calculate deviations from idealized trajectory.mt_deviations
Creates a difference-heatmap of two trajectory heatmap images.mt_diffmap
Compute distance matrix.mt_distmat
A mousetrap data object.mt_example
Raw mouse-tracking dataset for demonstrations of the mousetrap packagemt_example_raw
Exclude phase without mouse movement at end of trial.mt_exclude_finish
Exclude initial phase without mouse movement.mt_exclude_initiation
Export mouse-tracking data.mt_export_long mt_export_wide
Plot trajectory heatmap.mt_heatmap
Plot trajectory heatmap using ggplot.mt_heatmap_ggplot
Creates high-resolution heatmap of trajectory data.mt_heatmap_raw
Import mouse-tracking data saved in long format.mt_import_long
Import mouse-tracking data recorded using the mousetrap plug-ins in OpenSesame.mt_import_mousetrap
Import mouse-tracking data saved in wide format.mt_import_wide
Length normalize trajectories.mt_length_normalize
Map trajectories to prototypes.mt_map
Calculate mouse-tracking measures.mt_measures
Plot trajectory data.mt_plot mt_plot_aggregate
Add rectangles to trajectory plot.mt_plot_add_rect
Create PDF with separate plots per trajectory.mt_plot_per_trajectory
Plot density of mouse positions across time steps.mt_plot_riverbed
Mouse trajectory prototypes.mt_prototypes
Create quantile-effect plotmt_qeffect
Remap mouse trajectories.mt_remap_symmetric
Resample trajectories using a constant time interval.mt_resample
General-purpose reshape and aggregation function for mousetrap data.mt_reshape
Calculate sample entropy.mt_sample_entropy
Standardize variables in mouse trajectory array.mt_scale_trajectories
Spatialize trajectories.mt_spatialize
Standardize mouse-tracking measures per level of other variables.mt_standardize
Filter mousetrap data.mt_subset
Time normalize trajectories.mt_time_normalize
Generic print for class mt_heatmap_rawprint.mt_heatmap_raw
Read MouseTracker raw data.read_mt
Scale and center variables within the levels of another variable.scale_within