For each row of my data frame, I'm currently trying to select all duplicated values โโequal to 4 to set them to NA.
My dataframe is as follows:
dat <- read.table(text = " 1 1 1 2 2 4 4 4 1 2 1 1 4 4 4 4", header=FALSE)
I need to get:
1 1 1 2 2 4 NA NA 1 2 1 1 4 NA NA NA
I found information on how to eliminate duplicate rows or columns, but I really don't know how to proceed here .. thanks so much for any help
source share