formula of r in linear regression code example Example: how to do linear regression in r lm(y ~ . , data = ...)