Here is my regression model:

options(digits = 4)
fit <- lm(regFormula(), data = mtcars)
b   <- coef(fit)
summary(fit)

The fitting result is $mpg = r b[1] + r b[2]``r input$x$. Below is a scatter plot with the regression line.

par(mar = c(4, 4, 1, 1))
plot(regFormula(), data = mtcars, pch = 19, col = 'gray')
abline(fit, col = 'red', lwd = 2)


rstudio/shinycoreci documentation built on April 11, 2025, 3:17 p.m.