I'm trying to add a new variable (Day) to my df to indicate the first day an event occurs. For each batch the day value should be repeated until a new batch is listed. I've added some dummy data below. How can I do this?
df <- tibble(Batch=c(rep(123,5), rep(345,5)), Month = rep(seq(5),2))
df_day <- tibble(Batch= c(123,345), Day= c(3,6))