title: R expression from `nls` fit?
body: <p>I've fit a parametric function using <code>nls</code>, and now I want to print out an expression of the function with the learned parameters substituted back in.  For example:</p>
  
  <pre><code>x &lt;- runif(100, 0, 100)
  m &lt;- 13 * exp(-0.05 * x^2) + 0.1 + runif(100,0,0.1)
  mod &lt;- nls(m ~ a*exp(-b*x^2)+c, start=list(a=10,b=0.1,c=0.1))
  </code></pre>
  
  <p>I can extract the formula and coefficients like so:</p>
  
  <pre><code>formula(mod)
  # m ~ a * exp(-b * x^2) + c
  coef(mod)
  #           a           b           c 
  # 13.00029360  0.04975388  0.14457936 
  </code></pre>
  
  <p>But I don't see a way to substitute them back directly.  The only thing I can seem to do involves writing out the formula again:</p>
  
  <pre><code>substitute(m ~ a * exp(-b * x^2) + c, as.list(round(coef(mod), 4)))
  # m ~ 13.0003 * exp(-0.0498 * x^2) + 0.1446
  </code></pre>
  
  <p>My ultimate goal here is to read a fitted <code>nls</code> object from an RDS file on disk and show its functional expression in an <a href="http://orgmode.org" rel="nofollow">org-mode</a> document.</p>