You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a general question on whether the mousetrap package already conains the following functionality. I convert a mousetrap-object into long format, add one or several new variables to the long data and then I would like to transform the data back to mousetrap format. Consider the following example code:
Is there a possibility to reshape tr back to a mousetrap object like mt_example, where new_var is part of trajectories like "timestamps" "xpos" "ypos"?
The text was updated successfully, but these errors were encountered:
Thanks for the question/suggestion. Data in long format (which results in your example from using mt_reshape) can be imported using mt_import_long.
However, thanks for pointing out the issue with importing newly created variables. So far, mt_import_long has not supported custom variables. However, I introduced an additional argument add_labels to the function that allows for importing any additional variables. This is available now on GitHub and will be included in the next release.
Edit Aug 26, 7:00 pm:
I just reworked the function again to be more consistent with the previously released version of the package. The solution for your example now looks like this.
Short version (as the defaults for x- and y-positions and timestamps fit):
This is a general question on whether the mousetrap package already conains the following functionality. I convert a mousetrap-object into long format, add one or several new variables to the long data and then I would like to transform the data back to mousetrap format. Consider the following example code:
Is there a possibility to reshape
tr
back to a mousetrap object likemt_example
, wherenew_var
is part oftrajectories
like"timestamps" "xpos" "ypos"
?The text was updated successfully, but these errors were encountered: