I have the below dataset, and I would like to calculate the month interval of for each row.(Including the start month and end month)
month1 <- c("Jul-96","Aug-96","Sep-96")
month2 <- c("Jul-97","Sep-97","Nov-97")
data <- as.data.frame(cbind(month1,month2))
I would like to results to be a dataset as below:
month1 month2 interval
Jul-96 Jul-97 13
Aug-96 Sep-97 14
Sep-96 Nov-97 15
Thank you.