title: Using mutate over multiples columns with a for loop to recode values
body: <p>I need to recode values over multiple columns of a data frame based on another table.</p>
  <p>I have to recode the values of multiple columns of a data table using a side table.
  The values correspond to geographic identifiers that I must replace with place names.
  So I decided to do a loop but what works outside the loop doesn't work anymore .
  I can't use mutate in for loop.</p>
  <p><em>My real data contains 274 columns with 38 columns to recode. This columns have many different names (they aren't call places&quot;)</em></p>
  <p>my main dataset :</p>
  <pre><code> id &lt;- c(1, 2, 3)
   departure &lt;- c(1, 2, NA)
   arrival &lt;- c(3, 1, 2)
   transit &lt;- c(NA,NA,1)
  dataset &lt;- data.frame(id, departure, arrival, transit)
  </code></pre>
  <p>The other table :</p>
  <pre><code>geo_id &lt;- c(1, 2, 3)
  place_name &lt;- c(&quot;Paris&quot;, &quot;Nantes&quot;, &quot;London&quot;)
  geocode &lt;- data.frame(geo_id, place_name)
  </code></pre>
  <p>My loop :</p>
  <pre><code>var &lt;- c(&quot;departure&quot;, &quot;arrival&quot;, &quot;transit&quot;) #the columns that should by recode (must be a vector with my  real data)
  
  for (i in var) {
    print(i)
    dataset &lt;- dataset %&gt;% 
    mutate(i = geocode$place_name[match(i, geocode$geo_id)])
  
  }
  </code></pre>
  <p>mutate create a new column call <code>i</code> ! How to avoid this ?</p>