我正在尝试找到一个包或R code
可以帮助计算多个受试者的不同时间点的持续时间。
这是数据的样子
------------------------------------
SubjectID | Task |Duration
------------------------------------
A |Cleaning |0:10:01
A |Cleaning |2:33:54
A |Carpeting |0:16:16
A |Carpeting |0:19:23
A |Painting |0:20:16
B |Cleaning |1:45:60
B |Carpeting |0:15:01
B |Painting |1:15:10
B |Painting |0:15:60
C |Carpeting |1:16:16
C |Cleaning |0:20:16
C |Painting |0:30:10
-------------------------------------
我想要这张桌子
-----------------------------------------------------------------------------------
SubjectID |Number |Number |Number |Total number |Duration |
|of Cleaning |of Carpeting |of Painting | of Tasks |in hours |
-----------------------------------------------------------------------------------
A | 2 | 2 | 1 | 5 | 3:33:11 |
B | 1 | 1 | 2 | 4 | 3:52:18 |
C | 1 | 1 | 1 | 3 | 2:10:07 |
-----------------------------------------------------------------------------------
你知道可以帮助我获得表2的包或方法吗