0

I am doing a research on the influence of extreme weather events on migration. I am now building my dataset which looks like this:

dataset:

I need to create a new dataset which would give me the number of occurrences, total deaths and total affected for a period of 5 years (which would be the sum of the events that occurred during this period). In other words, I would like to create a table that would look like this: desired dataset:

I could do that by hand with excel, but the number of data is too important (the number of countries/ regions included is more than 200). Therefore, I need to use R. Do you have an idea of how I could proceed?

zx8754
  • 52,746
  • 12
  • 114
  • 209
  • 5
    Welcome to StackOverflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269). This will make it much easier for others to help you. – Sotos Dec 19 '17 at 15:21
  • 1
    Picutres of data aren't very useful. Better to give a proper [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). We also assume you've made some attempt to solve the problem yourself. Show the code you tried and describe exactly where you got stuck. Stack Overflow is not just a place to get people to do you work for you, we are here to help answer specific programming questions. – MrFlick Dec 19 '17 at 15:23
  • Read about `cut`, then group by sum. – zx8754 Dec 19 '17 at 15:28

0 Answers0