0byt3m1n1
Path:
C:
/
Program Files
/
R
/
R-4.2.2
/
library
/
knitr
/
doc
/
[
Home
]
File: knitr-intro.R
## ----show-off, tidy=TRUE------------------------------------------------------ options(digits=4) rnorm(20) fit=lm(dist~speed, data=cars) b=coef(fit) ## ----results='asis', echo=FALSE----------------------------------------------- knitr::kable(summary(fit)$coefficients, caption='Regression coefficients.') ## ----graphics, fig.cap='A scatterplot with a regression line.'---------------- par(mar=c(4, 4, 1, .1)) plot(cars, pch = 20) abline(fit, col = 'red')