Exercise

Quantifying the strength of a linear relationship

As you know, when a relationship looks linear you can quantify the strength of the relationship with the correlation coefficient. R has a very usefull function to calculate the correlation:

cor(input1, input2)

Instructions

100 XP

Calculate with the help of the function above the correlation between runs and at_bats. Assign the result to correlation.