title: How to loop over 2 dataframes or (lists) and replace every value with a label in R
body: <h6>My first variable called data</h6>
  <pre><code>index &lt;- seq(1:15)
  name &lt;- c('USA', &quot;UK&quot;, &quot;Canada&quot;, &quot;Mexico&quot;, &quot;Japan&quot;, &quot;Brazil&quot;, &quot;France&quot;, &quot;Portugal&quot;, &quot;Spain&quot;,
        &quot;Argentina&quot;, &quot;Qatar&quot;, &quot;Dubai&quot;, &quot;Malaysia&quot;, &quot;Indonésia&quot;, &quot;Signapour&quot;)
  data &lt;- cbind(index, name)
  </code></pre>
  <h6>My second variable called df:</h6>
  <pre><code> var_1 &lt;- 5 ;var_2 &lt;- 3 ;var_3 &lt;- 2 ;var_4 &lt;- 9
   var_5 &lt;- 1 ; var_6 &lt;- 6 ; var_7 &lt;- 7 ; var_8 &lt;- 8 ; var_9 &lt;- 4
   var_10 &lt;- 15 ; var_11 &lt;- 14 ; var_12 &lt;- 12 ; var_13 &lt;- 13
  var_14 &lt;- 11 ; var_15 &lt;- 10
  
  df &lt;- cbind.data.frame(var_1, var_2, var_3, var_4, var_5, var_6, var_7, var_8, var_9, var_10, 
   var_11, var_12, var_13, var_14, var_15)
  
  df 
  </code></pre>
  <h5>I want to create a loop using for() and if(), to replace every value in df for each variable with column &quot;name&quot; in data</h5>