title: Passing and referring to column name in a function
body: <p>I want to pass and then perform a simple swap on column values with a function.</p>
  
  <pre><code>Fix_Entries &lt;- function(Column){
    df$Column[which(df$Column == "-")] &lt;- "Y"
  }
  </code></pre>
  
  <p>However, I keep getting errors, and I can't find any reference to help me solve this!</p>
  
  <pre><code>Error in `$&lt;-.data.frame`(`*tmp*`, Column, value = character(0)) : 
    replacement has 0 rows, data has 8460
  </code></pre>