每个时间范围内的条目图计数

时间:2018-09-14 09:25:50

标签: r ggplot2

鉴于情况: 对于理论用户研究,记录参与者在游戏中的行为。 我们准确地保存何时它们的得分点,并希望观察它们在运行过程中的表现。 分数由正确答案的“ +1”,跳过问题的“ 0”和错误答案的“ -1”组成。

我从这张桌子开始:

   ParticipantID        Modus Timestamp Duration Point
1             70 Singleplayer      0.03     2.26     1
2             70 Singleplayer      0.53     2.26     1
3             70 Singleplayer      3.36     9.41    -1
4             70 Singleplayer     13.83     2.36     0
5             70 Singleplayer     17.25     8.71     1
6             70 Singleplayer     27.02     6.91     1
7             70 Singleplayer     35.00     3.22     1
8             70 Singleplayer     39.29     2.56     0
9             70 Singleplayer     42.91     6.51     1
10            70 Singleplayer     50.49     3.72     1
11            70 Singleplayer     55.25     2.96     1
12            71 Singleplayer      0.03     2.26     1
13            71 Singleplayer      3.38     9.41    -1
14            71 Singleplayer     13.20     2.36     0
15            71 Singleplayer     17.25     8.71     1
16            71 Singleplayer     27.02     6.91     1
17            71 Singleplayer     37.00     3.22     1
18            71 Singleplayer     39.29     2.56     0
19            71 Singleplayer     39.89     2.56     0
20            71 Singleplayer     42.91     6.51     1
21            71 Singleplayer     50.49     3.72     1
22            71 Singleplayer     55.25     2.96     1

使用这些命令...

df <- read.csv("C:\\Users\\AUser\\Documents\\DummyTestValues.csv")
dt <- as.data.table(df)
df$timeRange <- cut(df$Timestamp, breaks = c(seq(0,120,by=1)))

我在给定范围内将时隙分组在一起,并达到了这一点:

   ParticipantID        Modus Timestamp Duration Point timeRange
1             70 Singleplayer      0.03     2.26     1     (0,1]
2             70 Singleplayer      0.53     2.26     1     (0,1]
3             70 Singleplayer      3.36     9.41    -1     (3,4]
4             70 Singleplayer     13.83     2.36     0   (13,14]
5             70 Singleplayer     17.25     8.71     1   (17,18]
6             70 Singleplayer     27.02     6.91     1   (27,28]
7             70 Singleplayer     35.00     3.22     1   (34,35]
8             70 Singleplayer     39.29     2.56     0   (39,40]
9             70 Singleplayer     42.91     6.51     1   (42,43]
10            70 Singleplayer     50.49     3.72     1   (50,51]
11            70 Singleplayer     55.25     2.96     1   (55,56]
12            71 Singleplayer      0.03     2.26     1     (0,1]
13            71 Singleplayer      3.38     9.41    -1     (3,4]
14            71 Singleplayer     13.20     2.36     0   (13,14]
15            71 Singleplayer     17.25     8.71     1   (17,18]
16            71 Singleplayer     27.02     6.91     1   (27,28]
17            71 Singleplayer     37.00     3.22     1   (36,37]
18            71 Singleplayer     39.29     2.56     0   (39,40]
19            71 Singleplayer     39.89     2.56     0   (39,40]
20            71 Singleplayer     42.91     6.51     1   (42,43]
21            71 Singleplayer     50.49     3.72     1   (50,51]

我现在想要获得的是一个情节图,该情节遍历了x轴上的整个时间范围,并显示了每个玩家在每个时间范围内得分了多少个积极点。

(例如:玩家70在0-1秒之间取得了两个正分,依此类推)

0 个答案:

没有答案