My goal is to have a list of how much FDI China sent to each country per year. At the moment I have a list of individual projects that looks like this
| Year | Country | Amount |
|---|---|---|
| 2001 | Angola | 6000000 |
| 2001 | Angola | 8000000 |
| 2001 | Angola | 5.0E7 |
I want to sum it so it looks like this.
| Year | Country | Amount |
|---|---|---|
| 2001 | Angola | 6.4E7 |
How do I merge the rows and add the totals to get nice country-year data? I can't find an R command that does this precise thing.