I have a table of several faults similar to one below;
fault_ID date_reported date_closed fault hours
ab1 8/04/2019 1:36 8/04/2019 3:30 1.9
ab2 12/03/2019 18:48 12/03/2019 20:45 1.9
ab3 19/10/2018 22:00 20/10/2018 9:45 11.8
ab4 20/03/2019 10:07 20/03/2019 13:00 2.9
ab5 30/07/2019 8:37 30/07/2019 16:30 7.9
ab6 15/06/2019 12:58 18/06/2019 19:55 78.9
ab7 8/06/2019 22:30 8/06/2019 23:30 1.0
ab8 16/10/2018 0:45 16/10/2018 1:50 1.1
ab9 23/01/2019 1:44 23/01/2019 7:05 5.3
ab10 22/05/2019 6:19 26/07/2019 23:07 1,576.8
using R, I would like to summarise the fault hours per month to get the output below:
Month Total Fault hours
Oct-18 1.1
Nov-18 11.8
Dec-18 0.0
Jan-19 0.0
Feb-19 0.0
Mar-19 2.0
Apr-19 1.9
May-19 210.0
Jun-19 78.9
Jul-19 7.9
I have tried a few suggestions with lubridate but I only seem to be able to get it to work for one fault_ID at a time.. I'm new to R. Thanks in advance for your help.