Is it possible to include missing weeks when formatting date as week?

Was wondering if it was possible to include weeks that are missing when populating a variable by week? I've used week(date) to do this, but wish to include missing weeks as NA rows (there are gaps, i.e. 32, 33, 36).

Found a tool called date2week() from "aweek" package that claims to fill in missing weeks by factorising it, but to no avail.

Can attach reprex and such if needed, but didn't think it was needed.

It's always much better to include a reprex, so please do! This vignette from the tsibble package about missing time series data but have some answers for you:

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.