0

I have two dataframes (e.g., A and B) of different lengths and am attempting to extract the duplicate values between them.

The below is just a toy dataset because my real datasets are much longer:

A <- data.frame(c('g','f','a', 'e'))
B <- data.frame(c('a','b','c', 'd', 'e'))

Here the matching values between A and B are: a and e

I've attempted to use the library(comparison) but have only been able to check whether there are duplicates and if so, how many. Instead, I'd like to know which values are the duplicates. Non-working code below:

comparison <- compare(A,B,allowAll=TRUE)
comparison$tM
psychcoder
  • 543
  • 3
  • 14

0 Answers0