-2

I have 2 data frames that have usernames.

input1

username
akshay
bhanu
catherine
dennis

input2

username
akshay
bhanu
catherine
dennis
edward
francis

I have to find the matching words for 2 columns. Have around 120+ names on both columns, I just gave a few as an example. I tried a few ways but it says the length of data frames are different.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Siddharth
  • 192
  • 3
  • 20
  • I don't really understand if you have two data frame or one data frame with two columns – Ian.T Oct 05 '20 at 15:44
  • Does this answer your question? [Matching two Columns in R](https://stackoverflow.com/questions/36345915/matching-two-columns-in-r) – user438383 Oct 05 '20 at 15:45

1 Answers1

1

You can use the filter function from the dplyr package.

input1 = filter(username %in% input2$username)
Ian.T
  • 1,016
  • 1
  • 9
  • 19