Regarding plotting a regression fit - for a simple linear regression model the abline function adds the fitted line to a plot. plot(optden ~ carb, Formaldehyde) abline(fm1 <- lm(optden ~ carb, Formaldehyde))