knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
Fit a model with lm
():
model <- lm(mpg ~ 1 + cyl, mtcars) coefs <- coef(model) # prediction for 8 cylinders coefs["(Intercept)"] + 8 * coefs["cyl"] predict(model, data.frame(cyl = 8L))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.