Question regarding importing CSV data into mousetrap (non-standard use)
Hello all!,
I'm trying to use mousetrap to process some data that is not strictly speaking mouse movement data. The data I'm trying to analyse is player movements around a map (x,y coordinates of the video game Dota 2). The reason I want to use mousetrap is because I want to use time normalisation. What I have a readings of position changes and not a time series of player positions. Basically, if we take the X-coordinates of player A, the array of values can be shorter or longer than player B.
Maybe what I'm trying to do is not possible but I'm curious to try. Could someone direct me in how to use the mt_import functions? I've coreced the data into looking like the screenshot.
Thank you!
Comments
Hi there,
nice data. :) I think what you want to do could be possible with mousetrap. However, to perform time normalization you also require timestamps in addition to the x and y coordinates. Do you have these avaiable?
If so, you could try to import the dataset into mousetrap with the following code:
Note that I never used a space as split character so I don't really know if this will cause any issues so you should closely inspect the imported data
Afterwards, you could perform time normalization using mt_time_normalize (http://pascalkieslich.github.io/mousetrap/reference/mt_time_normalize.html):
Best,
Pascal
Hi! Thank you for your reply. I've been trying to coerce my data into a workable format all weekend haha. I finally managed to get some where with mt_import_long but alas, I don't have a timestamps variable. All I got is a reading which basically says "player00 moved to X, Y".. and its series of of these location changes.
Here's what I've got so far.
and when I do I end up with the shown mousetrap data
Do you have any suggestions? :D I would love to be able to plot the movements around the map using mt_plot but I don't know how feasible that is.
Thanks for your help!
I actually managed to figure it out ^_^
Great that it worked out! And I think that using mt_import_long completely makes sense for your application.
Thank you!
I've been trying to get the heat map to work but I keep getting the following error :
Any ideas? As an example, below is a screenshot of 1 player's movements through 16 matches. I'd love to make a heat map of this. Might be clearer than all the lines.
Thanks in advance!
Hi there,
I just googled this error message and found a discussion of it here: https://support.rstudio.com/hc/en-us/articles/4415936301335-Resolving-Rcpp-precious-remove-error
It seems that an update / reinstallation of the Rcpp package could fix the problem.
Best,
Pascal