title: Function that displays a text for the equation of a linear model
body: <p>I'd like to take the following &quot;eq&quot; function and improve it in two ways:</p>
  <ol>
  <li><p>So it can run for any number of coefficients</p>
  </li>
  <li><p>So it will make the variables display without the matrix portion i.e. like this:</p>
  <p>y == 0.29 + 0.18 * &quot;b&quot; + 0.4 * &quot;c&quot;</p>
  </li>
  </ol>
  <p>my code:</p>
  <pre><code>x=data.frame(runif(12),rep(c('a','b','c'),4))
  lm3=lm(x[,1]~x[,2])
  eq=function(c){
  bquote( y == .(c[1]) + .(c[2]) * .(names(c)[2])
          + .(c[3]) * .(names(c)[3])) }
  c=summary(lm3)$coefficients
  c=round(c[,1], digits = 2)
  c=summary(lm3)$coefficients
  c=round(c[,1], digits = 2)
  
      &gt; eq(c)
      y == 0.29 + 0.18 * &quot;x[, 2]b&quot; + 0.4 * &quot;x[, 2]c&quot;
  </code></pre>