date_df <- tibble(
date = rep(seq(as.Date("2025-01-01"), as.Date("2025-01-31"), by = "day"), each = 3),
gfu = rep(1:3, length.out = 93),
day = rep(weekdays(seq(as.Date("2025-01-01"), as.Date("2025-01-31"), by = "day")), each = 3),
# A1: Set some example logic for A1 (you can adjust as needed)
A1 = ifelse(rep(weekdays(seq(as.Date("2025-01-01"), as.Date("2025-01-31"), by = "day")), each = 3) == "Sunday", 0, rep(1:3, length.out = 93)),
# Set A2 based on the week number and position within the day (1, 2, 3)
)
date_df%>%
mutate(A2 = case_when(
week(date) %% 3 == 1 ~ c(1, 0, 0),
week(date) %% 3 == 2 ~ c(0, 2, 0),
week(date) %% 3 == 3 ~ c(0, 0, 3),
TRUE ~ 0 ))