You are viewing a single comment's thread. Return to all comments →
Code in R:
physics_scores <- c(15, 12, 8, 8, 7, 7, 7, 6, 5, 3) history_scores <- c(10, 25, 17, 11, 13, 17, 20, 13, 9, 15)
correlation <- cor(physics_scores, history_scores)
print(sprintf("%.3f", correlation)) It is giving correct value
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Correlation and Regression Lines - A Quick Recap #1
You are viewing a single comment's thread. Return to all comments →
Code in R:
physics_scores <- c(15, 12, 8, 8, 7, 7, 7, 6, 5, 3) history_scores <- c(10, 25, 17, 11, 13, 17, 20, 13, 9, 15)
correlation <- cor(physics_scores, history_scores)
print(sprintf("%.3f", correlation)) It is giving correct value