knitr::opts_chunk$set(echo = TRUE)
data(cats, package="MASS") source("ols.R") result<-ols(cbind(1,cats$Bwt),cats$Hwt) summary(result)
You can also embed plots, for example:
source("olslinmod.R") x = cbind(Const=1, Bwt=cats$Bwt) y = cats$Hw mod1 <- linmod(x, y) mod1 # summary(mod1)
summary(linmod(Hwt~Bwt*Sex, data=cats))
Note that the echo = FALSE
parameter was added to the code chunk to prevent printing of the R code that generated the plot.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.