I'm trying to find a package or R code
that can help to calculate the time duration of different time points for multiple subjects.
This is what the data looks like
------------------------------------
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
-------------------------------------
I want to get this table
-----------------------------------------------------------------------------------
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 |
-----------------------------------------------------------------------------------
Do you you know a package or an approach that can help me to get the table 2