I have 2 dataframes with different lenghts. Using the function below I have extracted every duplicate including originals and the duplicates appearing more than twice.
duplikat_n=matxt[(duplicated(matxt) | duplicated(matxt, fromLast = TRUE)), ]
Now I want to find at what Spot in the df matxt the duplicates are.
which(c(matxt==duplikat_n))
The following function gives me an error:
‘==’ only defined for equally-sized data frames
So how can I check at which location in the dataframe matxt my duplicates are located ?
Example:
s <- data.frame(Y = sample(c("yes", "no","yes","test")))
x<- data.frame (Z= sample(c("test","random","hello")))
Neither
which(s%in%x)
works nor a version with
==