Howdy, Stranger!

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

Supported by

An error occurred while entering the add_labels

Hello, when I input CSV data, after adding add_labels, for example add_labels = c("pic_type"), I will get an error error in mt_import_wide(data, xpos_label = "x", ypos_label = "y", add_labels = c("pic_type"), : 

 No variables found for pic_type.

My fully entered code is below

mt_data <- mt_import_wide(data,

              xpos_label = "x",     

              ypos_label = "y",  

              zpos_label = NULL,

              timestamps_label = "t",  

              add_labels = c("pic_type", "subID", "exp_type", "rt", "response", "left", "right", "correctresponse"),

              mt_id_label = NULL,

              pos_sep = "_",

              reset_timestamps = TRUE,

              verbose = TRUE

            )

Comments

  • Hi there,

    the use case of the add_labels argument is a bit different, see documentation (e.g., here: http://pascalkieslich.github.io/mousetrap/reference/mt_import_wide.html):

    add_labels = a character vector specifying the core of columns containing additional mouse-tracking variables.

    The idea is that you could use this to specifiy additional variables that are available for each recorded mouse position (e.g., acceleration or velocity). For example, in addition to the x positions (x_1, x_2, ...) etc. you could have velocity available in the vel columns (vel_1, vel_2, ...). Now you could specify add_labels = "vel" to import these.

    If you simply have additional variables available for a trial, like the ones in your examples above, these will be automatically imported and stored in mt_data$data and you don't need to specify them explicitly for mt_import_wide.

    Hope this helps!

    Best regards,

    Pascal

  • Dear Pascal:

    Thank you so much! Your answer helped me a lot!

Sign In or Register to comment.