Skip to content
Prev 378463 / 398502 Next

dates by week multiple years

Hi Keith,
Perhaps you do not want to go with calendar weeks:

365/7 = 52.14

as there are not an even number of weeks in a year, you may want to
plot by week from your initial observation. As you are using as.Date,
you could simply calculate weeks as:

data$Week<-1+as.numeric(data$Date - data$Date[1])%/%7

Jim
On Wed, Feb 6, 2019 at 4:52 PM Marlin Keith Cox <marlinkcox at gmail.com> wrote: