I have a dataframe with many cols. Some of the cols have vectors in them. What I want to do, is for everything in the df, if the elements of the vectors are identical, to change the vector to one element but if there is at least one difference, to keep it.
an example of my dataframe:
this is the output that I want
> if length(unique(each_vector))==1-> do nothing , otherwise, only choose the first element of the vector.
I would be thankful if someone could help