I have a dataset from Tobii Eyetracker. The dataset looks like this after cetain manipulations
timestamp xposition yposition
I used python for collecting the data. The data was recoreded while the participant was looking at the monitor. I want to generate heatmaps for the size of the monitor.
Later I also want to make an image and overlay this heatmap.
I want to use R to generate heatmaps. What is the algorithm to do this or is there is plugin to directly feed my dataset as input?
Experiment Setup:
- The time is relative time: 100,100.02,100.04,100.06..and so on incrementing in the order of .02 seconds
- The xPosition and yPosition is in Centimeter. From the centre of the monitor.
- The background image will be split into 10 row 6 column of square boxes with size 3.4cm each
- size of the monitor resolution used is 1920x1080 exact MonitorUsed
The code I ran with error: after exporting using dlmwrite in matlab, i used the GUI in R Studio to load the variables and did the following:
> xPos = myfile[1:278,1]
> yPos = myfile[1:278,2]
> breaks.x <- seq(-23.5, 23.5, length.out = 3.4)
> breaks.y <- seq(-14.1, 14.1, length.out = 3.4)
> int.x <- findInterval(xPos, breaks.x)
> int.y <- findInterval(yPos, breaks.y)
> tb <- table(int.x, int.y)
> image(breaks.x, breaks.y, tb, las=1)
Error in image.default(breaks.x, breaks.y, tb, las = 1) :
dimensions of z are not length(x)(-1) times length(y)(-1)
i did it between - to + 23.5 in the x and - to + 14.1 in y so that i matched with the points i generated while do the experiment. The images where plotted only in this region.