Hello, everyone,
I have to make a time series on iso-calendar weeks. My data are given on a daily basis. I want to aggregate them on ISO calendar week level over the respective product groups. However, I want to have the calendar week and the year in the data and format this as date or POSIXct so that I can create a time series afterwards.
Summarized:
Date (d-m-y) -> Isoweek/year as a new column but formated as.date --> Create time series (frequency 52) per product group (both individually and one large one for all)
My previous attempts have not worked:
data2 <- data %>%
mutate(new_date=as.Date(KW, format="%W"), new_date2=year(Date))
data3 <- data %>%
mutate(new_date=isoweek(date), new_date2=year(date))
Thank you very much for your help.
Enclosed you will find an excerpt from my data so that you can understand the structure.
Kind regards,
Lukas