I am new to R and not familiar with it. I have the following data:
Start.Date
1: 2020-09-15
2: 2021-08-10
3: 2015-08-25
4: 2021-10-11
5: 2021-08-15
6: 2018-06-05
7: 2021-06-10
8: 2020-05-13
9: 2021-08-03
10: 2017-12-25
I want to have the duration between the current date and the start date in months?
I tried the following but it didn't work:
install.packages("lubridate")
library("lubridate")
currentDate <- Sys.Date()
StartDate <- as.Date(Mall_Data$Start.Date, format = "%m/%d/%Y")
theduration<- interval(currentDate, StartDate) %% months(1)