Problem: Write an R function that uses a data frame with 2 columns and calculates the correlation between the two quantitative variables, and returns the sample correlation without using the cor() function.
P.S - Need an R function returning correlation between two columns of a data frame without using the cor() function.