I would like to mark my duplicated values with respect to one column
Example i have a df
X Y Z
1 4 5
2 5 7
1 3 6
7 2 7
then I want a new data frame df2 creating a new column dup which indicates whether X is duplicated or not as
X Y Z dup
1 4 5 TRUE
2 5 7 FALSE
1 3 6 TRUE
7 2 7 FALSE
Any who could tell me how to do it?