title: character string as function argument r
body: <p>I'm working with dplyr and created code to compute new data that is plotted with ggplot. </p>
  
  <p>I want to create a function with this code. It should take a name of a column of the data frame that is manipulated by dplyr. However, trying to work with columnnames does not work. Please consider the minimal example below:</p>
  
  <p><code>df &lt;- data.frame(A = seq(-5, 5, 1), B = seq(0,10,1))</code></p>
  
  <pre><code>library(dplyr)
  foo &lt;- function (x) {
           df %&gt;%
              filter(x &lt; 1)
  }
  
  foo(B)
  
  Error in filter_impl(.data, dots(...), environment()) : 
    object 'B' not found 
  </code></pre>
  
  <p>Is there any solution to use the name of a column as a function argument?</p>