R - Concatenate cell in dataframe, by group, depending on another cell value
问题 I have a dataset of the following type (first row is the header): content is always text merge is always a logical id1 id2 start_line end_line content merge A B 1 1 "aaaa" TRUE A B 4 4 "aa mm" TRUE A B 5 5 "boool" TRUE A B 6 6 "omw" TRUE C D 6 6 "hear!" TRUE C D 7 7 " me out!" TRUE C D 21 21 "hello" FALSE Problem: I need to merge following a very specific criteria: Rows that have merge = FALSE must remain as is Rows that have: same id1 , same id2 and consecutive start_line : Need to be