Advertisements I have this df1 library(dplyr) library(tidyverse) df1 = data.frame(ID = c(100,101,101,102,102,103,103,104,104,105,106), x_line = c(1,1,2,1,2,1,2,1,2,1,1), start_date = c(’04/01/2018′,’05/01/2019′,’25/08/2021′,’08/03/2017′,’07/08/2018′, ’09/04/2016′,’29/12/2018′,’04/08/2018′,’03/05/2022′,’04/01/2018′,’04/01/2018′), end_date = c(’04/05/2019′,’07/02/2020′,’27/09/2021′,’18/07/2018′,’17/10/2019′, ’19/12/2018′,’22/12/2019′,’14/09/2021′,’26/12/2022′,’15/02/2020′,’24/08/2020′) ) and the following df2 df2 = data.frame(ID = c(100,100,100,101,101,102,102,103,103,104,104,105,105,106,106,106), product_name = c(‘AA’,’BB’,’CC’,’AA’,’CC’,’DD’,’EE’,’DD’,’FF’, ‘AA’,’FF’,’DD’,’AA’,’CC’,’AA’,’BB’), start_taken_date = c(’04/05/2018′,’25/08/2018′,’27/09/2018′,’18/07/2019′,’25/11/2019′, ’29/01/2018′,’07/09/2018′,’14/09/2017′,’01/01/2019′,’15/02/2019′,’24/08/2020′, ’04/03/2019′,’04/08/2018′, ’05/05/2018′,’06/06/2019′,’08/09/2018′), end_taken_date = c(’01/05/2019′,’26/09/2018′,’25/03/2019′,’25/09/2019′,’02/01/2020′, ’19/06/2018′,’22/09/2019′,’16/01/2018′,’04/03/2019′,’25/06/2022′,’23/07/2022′, ’05/04/2019′,’05/09/2018′, ’29/03/2019′,’07/07/2019′,’04/05/2020′)) df3 is the result of merging… Read More How to merge two dataframes based on the condition of a startdate and enddate?