I have a wide data frame, where one column has a variable name and the other columns have measurements. For each cell in a column I would like to paste in the percentage value that cell contributes to the whole column.
So for example, I would like to take this:
Ship Month1 Month2 Month3 Month4
---------------------------------------------
A 5 10 5 10
B 7 30 5 0
C 3 5 5 0
D 5 5 5 0
And have in its place something like this:
Ship Month1 Month2 Month3 Month4
------------------------------------------------------------------
A 5 (25%) 10 (20%) 5 (25%) 10 (100%)
B 7 (35%) 30 (60%) 5 (25%) 0 (0%)
C 3 (15%) 5 (10%) 5 (25%) 0 (0%)
D 5 (25%) 5 (10%) 5 (25%) 0 (0%)
How would I be able to go around doing that?