title: Passing a column name to written function which uses dplyr functions
body: <p>I have a function that I wrote which is supposed to filter some values and then produce a crosstabulation. It filters the values using the dplyr filter,select commands.</p>
  
  <p>My problem is that when I pass the name of the column ot the function I get an error, and when I pass the name as string with "" around it, it does not filter the observations.
  Here is the code:</p>
  
  <pre><code>fnDoCrosstab &lt;- function(a) {
    x &lt;- surv_data1 %&gt;% filter(a != "blank") %&gt;% select(a) %&gt;% as.matrix() %&gt;% as.vector()
    y &lt;- surv_data1 %&gt;% filter(a != "blank") %&gt;% select(segment_name) %&gt;% as.matrix() %&gt;% as.vector()
    CrossTable(x,y, format = "SPSS",prop.chisq = F)
  }
  fnDoCrosstab(b_thisyear)
  </code></pre>