0

I have a data frame id_df of ids:

id 
1434903254
3940505900
5902309590
...

and another data frame df with ids and some other fields:

id          field1  field2
3905094505  390300  929300
9503205909  030932  023039
3950259005  032030  023090
...

I want to filter df to have only rows with the ids from the id_df.

11thal11thal
  • 333
  • 3
  • 13

1 Answers1

3

We can use

subset(df1, id %in% df2$id)
akrun
  • 874,273
  • 37
  • 540
  • 662