title: Write summary of fit in pdf file or similar
body: <p>I'm doing a linear fitting on many datasets in a loop and plotting the results in a pdf file. Is it possible to directly save the output of summary(fit) in the same pdf file instead of observing the summaries of about 100 datasets through the console?</p>
  
  <pre><code>  LMmodel &lt;- y ~ x
    fit &lt;- lm(LMmodel, data = Dataset)
  
    pdf(file = OutputFile, width = 10, height = 6, paper = "a4r")
  
    xLim = range(x)
    yLim = range(y)
  
    plot(x, y, type = "p", xlim = xLim, ylim = yLim,
         main = plotTitle, xlab = "x [m]", ylab = "y [dB]",
         pch = 20, cex = .9)
    regLine(fit, col=palette()[2], lwd=2, lty=1)
    grid(lwd = 1.5)
  
    plot(density(residuals(fit)), main = "Density Plot of the Residuals"))
  
    dev.off()
    graphics.off()
    return(summary(fit))
  </code></pre>