test
a b c d e f g
1 27 56 87 32 0 5 6
2 0 0 20 21 12 5 6
I would like to sum the column data to create a new row, like this:
test1
a b c d e f g
1 27 56 87 32 0 5 6
2 0 0 20 21 12 5 6
12 27 56 107 53 12 10 12
This seems like it should be really easy to do, but can't seem to figure it out. That or I am using the wrong search syntax to do a search for this topic. Any help greatly appreciated.
I think the expected result of adding 1 and 2 in your example first columns is wrong, or at least doesn't correspond to the other summations which use addition
Hi all,
just a clarification, the first column was just a rowname: "1", and "2", with a rowname "12" in the summed dataframe. Sorry for the confusion.
Both the solutions proposed by jrkrideau and ainsuasty seemed to work.
Thank you for the advice