I have a data frame which has two columns of dates in the format yyyy/mm/dd. I am trying to calculate the number of days between these two dates for each observation within
You could find the difference between dates in columns in a data frame by using the function difftime as follows:
difftime
df$diff_in_days<- difftime(df$datevar1 ,df$datevar2 , units = c("days"))