R code: Correlation and linear regression