The following is a data example,
Month Year Tornado Location
January 1998 3 Illinois
February 1998 2 Illinois
March 1998 5 Illinois
January 1998 1 Florida
January 2010 3 Illinois
Here is what I want it to look like essentially,
Date Tornado
1998-01 4
1998-02 2
1998-03 5
2010-01 3
So, I want to combine the Year and Month into one, new column. The locations do not matter, I want to know the total number of tornadoes for January, 1998, and etc. I have the following code, but do not know how to change it to incorporate both the variables I want, or if this is even the correct code for what I am attempting to do.
mydata$Date <- format(as.Date(mydata$month), "%m-%Y")
The real dataset is far too large to fix manually. I am basically attempting to make this data into time series data.