title: function with variable column name
body: <p>I have a function that I repeatedly use to summarize information for individuals (with unique ID's within my datasets.  Due to how this data is arranged, sometimes the ID column has one name, and other times it has another name.  Rather than having different functions for each dataset, I'm trying have an IDtype field in my function so I can specify the column in each dataset where the ID field is located.  However, I keep getting the following error for my function below:</p>
  
  <pre><code>fun &lt;- function(df, IDtype) {
    df %&gt;%
      group_by(species, IDtype, site) %&gt;%
      summarize(tsMean = mean(ts)) %&gt;%
      arrange(IDtype, tsMean)
  }
  
  dfSum &lt;- (fun(data, IDtype = id) #also tried with id in quotes ("id"), but I get the same error 
  
  Error: Column `IDtype` is unknown 
  </code></pre>
  
  <p>How do I fix this function?</p>