I want to insert rows between two dates by group. My way of doing it is so complicated that I insert missing values by last observation carry forwards and then merge. I was wond
The simplest way that I have found to do this is with the padr library.
padr
library(padr) dt_padded <- pad(dt, group = "user", by = "date") %>% replace_na(list(dummy=0))