I believe this question hasn't been answered for week dates, yet.
Suppose I have:
date1 <- '2015-W23'
date2 <- '2015-W30'
I want to compute the difference between these two dates as follows:
print(date1 - date2)
7
How can I do this? Thanks
I believe this question hasn't been answered for week dates, yet.
Suppose I have:
date1 <- '2015-W23'
date2 <- '2015-W30'
I want to compute the difference between these two dates as follows:
print(date1 - date2)
7
How can I do this? Thanks
How about using tsibble
package?
library(tsibble)
yearweek('2015-W23') - yearweek('2015-W30')
Time difference of -7 weeks