How to transfer multiple factors into one row?
<p>I have a dataframe with 8 variables:</p>

<p><a href="https://i.stack.imgur.com/67gyc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/67gyc.png" alt="enter image description here"></a></p>

<p>For the variable <code>Labor Category</code>, we have 5 factors: Holiday Worked, Regular, Overtime, Training, Other Worked. </p>

<p>The question is: Can I find a way to aggregate rows with same values except <code>Labor Category</code> and sum up the <code>Sum_FTE</code>variable？</p>

<p>i.e. Can we reduce the number of rows while add more columns:</p>

<p>"Labor.CategoryHoliday.Worked","Labor.CategoryOther.Worked","Labor.CategoryOvertime","Labor.CategoryRegular","Labor.CategoryTraining" and use 0 or 1 to indicate the status of each factor. And then sum up the Total FTE from rows with same values except Labor Category.</p>

<p><a href="https://i.stack.imgur.com/8JgcA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8JgcA.png" alt="enter image description here"></a></p>