title: Pass string variable into R function
body: <p>I want to pass a variable name into a function and can't seem to do it. Simply...</p>
  
  <pre><code>library (reshape)
  test &lt;- function(x) {
   cast(data, x ~ ., length)
  }
  test(ageg)
  </code></pre>
  
  <p>I get this kickback. </p>
  
  <pre><code>Error: Casting formula contains variables not found in molten data: x
  </code></pre>
  
  <p>I know it's simple but I can't find the answer.I want it to simply run </p>
  
  <pre><code>cast(data, ageg ~ ., length)
  </code></pre>