I have df like the one on the left. I would like to add subtotal row for each subject (highlighted in yellow in the right-side table).Currently my codes are able to achieve my goal but in a very silly way. I have to do the summary one by one.
I have df like the one on the left. I would like to add subtotal row for each subject (highlighted in yellow in the right-side table).Currently my codes are able to achieve my goal but in a very silly way. I have to do the summary one by one.