R Extract a column comparing two column of two dataframes : I'm little bit stuck in R

I have two dataframe.

I Want to compare two column from different dataframe and extract values of another column based on the matching position of the 2 columns compared.

[![enter image description here][1]][1]

[![enter image description here][2]][2]

So here there is my 2 dataframe. I want the half_data_means for which range_mean and a match.

What I tried is:

    mean_test=df_half_data_mean_with_NA[df_half_data_mean_with_NA$range_mean %in% test$a,]

But I got all dataframe for the matching values.


  [1]: https://i.stack.imgur.com/2P2Jq.png
  [2]: https://i.stack.imgur.com/heBfX.png