mt_resample(data, use = "trajectories", save_as = "rs_trajectories", step_size = 10, exact_last_timestamp = TRUE, show_progress = TRUE)use will be ignored).FALSE, the
last timestamp is only appended if it is a multiple of the step_size.rs_trajectories) containing the resampled
trajectories. If a trajectory array was provided directly as data,
only the resampled trajectories will be returned.
mt_resample can be used if the number of logged positions in a trial
should be reduced. mt_resample achieves this by artificially
decreasing the resolution with which the positions were recorded. For
example, if mouse positions were recorded every 10 ms in an experiment, but
one was only interested in the exact mouse position every 50 ms,
mt_resample with step_size=50 could be used. In this case, only
every fifth sample would be kept.In addition, mt_resample can be used to only retain values for
specific timestamps across trials (e.g., if for each trial the position of
the mouse exactly 250 ms and 500 ms after onset of the trial are of
interest). In case that a trial does not contain samples at the specified
timestamps, linear interpolation is performed using the two adjacent
timestamps.
Note that mt_resample does not average across time intervals. For
this, mt_average can be used.
mt_average for averaging trajectories across constant time intervals.
mt_time_normalize for time-normalizing trajectories.
mt_example <- mt_resample(mt_example,
save_as="rs_trajectories",
step_size=50)
Run the code above in your browser using DataLab