Fixed correlation coefficient calculation

Originally, I found out the issue by calculating linear regression `linreg()` of points parallel to x-axis.

* Correlation coefficient r() was returning NaN if the standard deviation of y was 0 (because all y values were equal)
* Added test for calculating linear regression with points containing same y coordinate values

Let me know if I need to do anything else to get it merged. Thanks.