I have to prepare charts with R for a case study. I have a dataset containing tens of thousands of rows organized as follows:
Platform | Profits
Desktop  |  608.50
Desktop  |  591.54
Desktop  |   83.21
Mobile   |   27.13
Mobile   |  133.81
Mobile   |  201.13
There are tens of thousands more Desktop and Mobile rows and their profits than what I posted, but I would like to know if there is a way for me to combine all of the Desktop and Mobile profits so that the resulting table is as follows so I can graph the totals easier:
Platform | Profit
Desktop  |5839.01
Mobile   |4219.58
I tried subset, sumRows, sumCols, but I can't seem to make a table of this desired format. I am 100% okay with having to break this into parts.
 
     
    