Q: Add row to sum each column in dataset in R I have a table with 8 defined sectors as rows and time periods as the column.
                    2001 Q1      2001 Q2    2001 Q3
    Agriculture       500          400        300
    Manufacturing     100          150        100
    Finance           1000        1500        1000
   TOTAL?

I am trying to sum each column but it seems the data is 'factor with 8 levels'. 8 is the amount of sectors I have. Please help on the best solution for summing up each column and/or changing the data format to numeric? 

A: We can use addmargins
addmargins(as.matrix(df1), 1)

