Skip to content
Prev 361202 / 398513 Next

rollapply and difftime

You want the number of days between dates?
Does this do the trick?

dts <- Sys.Date()+ c(1,2,3,5,6,9)
dts[-1] - dts[-length(dts)]

Time differences in days
[1] 1 1 2 1 3