I currently have a dataframe in R named as df. The df looks something like this:
con A B C D
ab 24 34 2 16
ba 47 12 23 21
cd 23 1 2 32
Now, i want the sum of all the rows(ab,ba,cd...n) in each column (A,B,C,D....n) and add or append one row at the bottom with all total values. After the sum, the data should look something like this:
con A B C D
ab 24 34 2 16
ba 47 12 23 21
cd 23 1 2 32
sum 94 47 27 69