title: how to write R code that calculate correlation coefficient for 2 numbers
body: <p>I have X = [2,3,5,10,8,5] Y = [7,6,9,1,6,3] variables I want to calculate correlation coefficient between them but without using &quot;cor(X,Y)&quot; function how can I achieve that?
  <a href="https://i.stack.imgur.com/ITPlZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ITPlZ.png" alt="enter image description here" /></a></p>