Learn R Programming

mousetrap (version 1.2.0)

mt_space_normalize: Space normalize trajectories.

Description

Adjust trajectories so that all trajectories have an identical start and end point. If no end points are provided, trajectories are only adjusted so that they have the same start position.

Usage

mt_space_normalize(data, use = "trajectories", save_as = "sn_trajectories", xpos_start = 0, xpos_end = NULL, ypos_start = 0, ypos_end = NULL, show_progress = TRUE)

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 resulting trajectory data should be stored.
xpos_start
an integer specifying the value the first x-position should have in each trial.
xpos_end
an integer specifying the value the last x-position should have in each trial. If NULL, trajectories are only adjusted so that they have the same start position.
ypos_start
an integer specifying the value the first y-position should have in each trial.
ypos_end
an integer specifying the value the last y-position should have in each trial. If NULL, trajectories are only adjusted so that they have the same start position.
show_progress
logical indicating whether function should report on its progress.

Value

A mousetrap data object (see mt_example) with an additional array (by default called sn_trajectories) containing the space-normalized trajectories. If a trajectory array was provided directly as data, only the space-normalized trajectories will be returned.

References

Dale, R., Kehoe, C., & Spivey, M. J. (2007). Graded motor responses in the time course of categorizing atypical exemplars. Memory & Cognition, 35(1), 15-28.

See Also

mt_align_start for aligning the start position of trajectories. mt_remap_symmetric for remapping trajectories.

Examples

Run this code
mt_example <- mt_space_normalize(mt_example,
  save_as ="sn_trajectories",
  xpos_start=0, xpos_end=-1,
  ypos_start=0, ypos_end=1)

Run the code above in your browser using DataLab