Detect in a line same values, and merge others

Hello ! I'm trying to remove lines in my data frame where values of columns 1 and 3 are the same. But if column 2 are differents between these lines, i wanna merge them. All the data frame contain characters, no integers. Is there a fast way to do that ?

a reprex would make it easier to assist you as it would save a helper work in inventing examples of your data to demonstrate solutions on. FAQ: How to do a minimal reproducible example ( reprex ) for beginners

Are you familiar with the tidyverse package ? there are convenient functions therein.
filter() for dropping rows that meet conditions. mutate() to make new variable (perhaps to hold condition flags), case_when() is often useful for multivalue conditions, and base paste() function is oft used for merging character strings.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.