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,
pdf("output.pdf")
x=rnorm(100,40,3)
y=rnorm(100,100,5)
fit=lm(y~x)
summary(fit)
plot(y)
dev.off()
This code gives me graph in pdf but I want all the summary of fit (ANOVA) and all information that R generates. Thanks
Yes, RMarkdown/knitr is the way to go.
See here for the documentation for creating a pdf document.
Your Rmd file might look something like the following:
For an html document, simply change to
output: html_document
.Render the pdf or html document with
rmarkdown::render('filepath/yourfile.Rmd')