title: How to generate report in pdf format using R
body: <p>I am trying to find out the R code which will give me the output of the statistical analysis(i.e. Regression, DOE, Gage RR) in pdf or html format by using R ( Not by using R-studio). I want to generate report of my statistical analysis. Is there any R code which we can run in to the R to make pdf or html file ??. I know it for graphs only,</p>
  
  <pre><code>pdf("output.pdf")
  x=rnorm(100,40,3)
  y=rnorm(100,100,5)
  fit=lm(y~x)
  summary(fit)
  plot(y)
  dev.off()
  </code></pre>
  
  <p>This code gives me graph in pdf but I want all the summary of fit (ANOVA) and all information that R generates. Thanks </p>