inst/doc/knitr-intro.R

options(digits = 4)
rnorm(20)
fit = lm(dist ~ speed, data = cars)
b = coef(fit)

summary(fit)$coefficients

par(mar=c(4, 4, 1, .1))
plot(cars, pch = 20)
abline(fit, col = 'red')

print(citation('knitr'), style = 'html')

Try the knitr package in your browser

Any scripts or data that you put into this service are public.

knitr documentation built on April 4, 2025, 5:15 a.m.