title: Create A Column with Value Based on Function Input
body: <p>This question has sort of been asked multiple times, including in this example: <a href="https://stackoverflow.com/questions/22901597/lapply-to-add-columns-to-each-dataframe-in-a-list">Lapply to Add Columns to Each Dataframe in a List</a>. </p>
  
  <p>However, I simply want to add an argument within a function that creates a new column, and that column has a value based on input. </p>
  
  <pre><code>dfs&lt;-lapply(clients_names, function(x){
  
  df&lt;-read.csv(...),
  
  ##this is when I want to add a column to the df loaded,
  ##a column of clients with names their names)
  
  return(df)
  })
  </code></pre>
  
  <p>I tried using <code>df$clients&lt;- x</code> in place of <code>##</code> but that did not work. </p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <pre><code>client_names&lt;-c("Bob", "Sam", "Chris")
  </code></pre>