Hi, I have difficulty to find total hours of a particular role type. Explanation is below:
Shift# Role type Working hours
1 Nurse 3
1 Nurse 2
1 Nurse 5
1 MD 2
1 PA 7
2 Nurse 3
2 Nurse 7
2 MD 4
2 MD 2
3 Nurse 6
3 Nurse 3
3 MD 2
3 PA 1
.
.
.
250
Shift # represent number of shifts (9 am to 5 pm) for one year, role type represents the type of a staff (e.g. a nurse, MD, etc) that comes during a shift and I want my data frame to be like the following for 250 shift:
Shift # Nurse MD PA
1 10 2 7
2 10 6 0
3 9 2 1
.
.
.
250
in the above examples, I sum number of hours for each role type for each shift.