Function used for linear regression in R is code example Example: how to do linear regression in r lm(y ~ . , data = ...)