Fill up rows of a data frame

Hello! This can be achieved by using the complete() function. I believe the following will work for you:

dat %>% 
  group_by(article) %>% 
  complete(date = seq.Date(from = as_date("2020-07-01"),
                           to = as_date("2020-07-31"),
                           by = "day"),
           fill = list(sales = 0))

See a similar question here

1 Like