title: R use purrr::map to apply a function on a selected columns in a dataframe list
body: <p>I have a list of dataframes, where some columns need specification of their correct  encoding. So, I have created a function to set the correct encoding, and I would like to apply this new function to the specific columns in my dataframes list. How can I do this with <code>purrr:map</code>? I am very new to it. </p>
  
  <hr>
  
  <p>Dummy example</p>
  
  <pre><code># Set slovak characters
  Sys.setlocale(category = "LC_ALL", locale = "Slovak")
  
  
  # Make a function    
  setEncoding&lt;- function(x, ...) {
      Encoding(x)&lt;-"UTF-8"  # set correct encoding on the vector
      x                     # print the output
  }
  
  # Create dummy data with wrong encoding
  df1&lt;-data.frame(name = "Ä˝ubietovskĂ˝ Vepor",
                  psb = "S CHKO PoÄľana",
                  numb = 1)
  
  df2&lt;-data.frame(name = "GoliaĹˇovĂˇ",
                  psb = "S TANAP",
                  numb = 2)
  
  list1&lt;-list(df1, df2)
  
  My function seems working if applied on vector string:
  
  &gt;setEncoding(c("Ä˝ubietovskĂ˝ Vepor", "GoliaĹˇovĂˇ" ))
  [1] "Ľubietovský Vepor" "Goliašová"  
  
  # How to apply the whatever function (here setEncoding) on the selected columns from a dataframe list?? 
  
  list1 %&gt;%
    map(setEncoding[c("name", "psb")]) # How to fix this?
  </code></pre>
  
  <hr>
  
  <p>What I wish to obtain (correct encoding of columns <code>name</code>, <code>psb</code>):</p>
  
  <pre><code>&gt; ls
  [[1]]
           name            psb numb
  1 Ľubietovský Vepor S CHKO Poľana    1
  
  [[2]]
           name     psb numb
  1 Goliášová S TANAP    2
  </code></pre>