title: Extract formula from model in R
body: <p>I'm building a function for many model types which needs to extract the formula used to make the model.  Is there a flexible way to do this?  For example:</p>
  
  <pre><code>x &lt;- rnorm(10)
  y &lt;- rnorm(10)
  z &lt;- rnorm(10)
  equation &lt;- z ~ x + y
  model &lt;- lm(equation)
  </code></pre>
  
  <p>I what I need to do is extract the formula object "equation" once being passed the model. </p>