my x is 10th week of 2015 and y is 20th week of 2015.
x<-as.Date("201510", "%Y%U")
y<-as.Date("201520", "%Y%U")
I want to get difference between x-y in number of weeks. So x-y should be -10. When I try with following codes, I get 0 or 0s.
interval(x, y) / weeks(1)
this gives me 0
as.period(x- y, unit = "weeks")
this gives me 0s.
What am I missing here?