#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

# mt_measures error: Error in points[1, ] : incorrect number of dimensions

edited February 17

We collected data from about 80 participants with no problems using mt_measures, but for some reason adding the 81st participant's .csv file leads to the following error when using mt_measures:

mt_measures(dta.mt, verbose=TRUE)

Start calculating deviations of actual from idealized response trajectory.
100 trials finished
200 trials finished
300 trials finished
400 trials finished
500 trials finished
600 trials finished
700 trials finished
800 trials finished
Error in points[1, ] : incorrect number of dimensions

Question 1) When I open the .csv in Excel, I don't see any obvious problems, and I'm not sure how to identify what might be wrong with the underlying .csv file based on the error message (dimensions of ___?).

Question 2) I'm also wondering how I can input custom coordinates for target locations (endpoints) to be used for calculating deviations from the idealized trajectory, and whether this might help. I see how to do this globally (i.e., if all targets had the same endpoint), but I'm wondering if it's possible to specify different endpoints by target (there are 15 different targets, each with a different ideal endpoint).

Thanks!
J

• edited February 17

I think I found the .csv problem (Question 1 above): one participant has only 2 points in the timestamps and x and y position columns (maybe an immediate click when the trial started?) for 2 of the 15 or so trials. Is there a way to omit these trajectories on import?

• Hi J,

regarding question 1: you identified the problem correctly - you need more than 2 recorded positions.

Mousetrap provides a function for counting the number of recorded positions which can then be used to exclude the trials. An example could look like this:

``````library(mousetrap)

# Import example raw data
mt_example <- mt_import_mousetrap(mt_example_raw)

# Count number of recorded positions per trial
mt_example <- mt_count(mt_example, save_as = "data")

# Look at number of of recorded positions
table(mt_example\$data\$nobs)

# Only keep trials with more than 2 recorded positions
mt_example <- mt_subset(mt_example, nobs>2)

``````

Best,

Pascal

• Regarding question 2: indvidual ideal end points per trial (other than the actual start and end points, that are ued by default) are so far not implemented in mt_deviations. As a workaround, you could create subsets of the data using mt_subset for each target that has a different ideal start and end point and run mt_deviations separately for each subset.