I have the following data frame in R, which have duplicated characters in each row.
i01 A A A A A A
i02 B C D B C D
i03 E F E F E F
i04 G G G G G G
i05 H I J K L M
i06 N O P N O P
I want to keep only the unique score in each row in the entire data frame, and replace the duplicate scores either by a blank or NA. Something like this:
i01 A NA NA NA NA NA
i02 B C D NA NA NA
i03 E F NA NA NA NA
i04 G NA NA NA NA NA
i05 H I J K L M
i06 N O P NA NA NA
I am trying by simply using unique function in the entire data frame but it doesn't work.