首页 > 解决方案 > R 扫视分析

问题描述

块引用

我得到了 x/y 坐标和时间戳形式的眼动追踪凝视数据。

现在我想使用 R 包绘制眼跳saccades。不幸的是,它不起作用。我想这是数据格式错误的问题。

我的数据:

> View(EUFKDCDL_Q09AS_saccades_2)
> head(EUFKDCDL_Q09AS_saccades)
# A tibble: 6 x 4
           time     x     y trial
          <dbl> <dbl> <dbl> <dbl>
1 1550093577941   732   391     1
2 1550093577962   706   320     1
3 1550093577980   666   352     1
4 1550093578000   886   288     1
5 1550093578017   787   221     1
6 1550093578037   729   302     1

不起作用的代码:

> fixations <- detect.fixations(EUFKDCDL_Q09AS_saccades)
Error in detect.fixations(EUFKDCDL_Q09AS_saccades) : 
  No saccades were detected.  Something went wrong.

应该根据 github 工作的完整代码(它与示例数据一起):

> library(saccades)
> data(samples)
> head(samples)
      time     x      y trial
1    0 53.18 375.73     1
2    4 53.20 375.79     1
3    8 53.35 376.14     1
4   12 53.92 376.39     1
5   16 54.14 376.52     1
6   20 54.46 376.74     1
> fixations <- detect.fixations(samples)
> head(fixations[c(1,4,5,10)])
  trial        x         y  dur
0     1 53.81296 377.40741   71
1     1 39.68156 379.58711  184
2     1 59.99267 379.92467   79
3     1 18.97898  56.94046  147
4     1 40.28365  39.03599  980
5     1 47.36547  35.39441 1310
> diagnostic.plot(samples, fixations)

所以我猜我的数据结构一定有问题吗?是什么意思?

我希望你们中的任何人都可以帮助我创建这个扫视图,如所附的截图所示扫视图

我也是R新手……请耐心等待。:D

标签: rggplot2

解决方案


推荐阅读