title: search 2 different columns in 2 different dataset in R
body: <p>I have 2 data frames :</p>
  
  <p><code>df1</code>, with only strings</p>
  
  <pre><code>Act1
  ESP
  BCN
  FTP
  </code></pre>
  
  <p>And a second data frame <code>df2</code> with string and numeric values</p>
  
  <pre><code>Act val
  ESP   1
  FR    2
  FTP   3
  BCN   4
  </code></pre>
  
  <p>I want to replace values in column <code>Act1</code> by the associated number in column val, if <code>df1$Act == df2$Act</code> doing a for loop or something similar to compare values for the 2 different data set and columns</p>
  
  <p>get a third data frame <code>df3</code> with</p>
  
  <pre><code>Act1
  1
  4
  3
  </code></pre>