title: pull out p-values and r-squared from a linear regression
body: <p>How do you pull out the p-value (for the significance of the coefficient of the single explanatory variable being non-zero) and R-squared value from a simple linear regression model? For example...</p>
  
  <pre><code>x = cumsum(c(0, runif(100, -1, +1)))
  y = cumsum(c(0, runif(100, -1, +1)))
  fit = lm(y ~ x)
  summary(fit)
  </code></pre>
  
  <p>I know that <code>summary(fit)</code> <em>displays</em> the p-value and R-squared value, but I want to be able to stick these into other variables.</p>