Howdy, Stranger!

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

Supported by

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:

    mt_data <- mt_import_mousetrap(
      raw_data, mt_id_label = "mt_id_label",
      xpos_label = "X", ypos_label = "Y", timestamps_label = "YOURTIMEVARIABLE",
      split = " "
    )
    

    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):

    mt_data <- mt_time_normalize(mt_data)
    

    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

    mt_import_long(mt_data_raw, xpos_label = "X", ypos_label = "Y",mt_id_label = "Match_number", )
    
    

    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

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games