Skip to content
Prev 278630 / 398503 Next

Missing data?

On Sun, Nov 27, 2011 at 8:10 PM, Kevin Burton <rkevinburton at charter.net> wrote:
It would be the same except replace the calculation of yr.wk with:

tt <- time(z)
yr.wk <- as.numeric(format(tt, "%Y")) + pmin(as.numeric(format(tt,
"%W")), 51)/52

This puts the 1st Sunday of the year and the days prior to it in week
0, the next 7 days are in week 1 and so on.  All days after the 51st
Sunday are either in week 51 or are forced to be.