title: IQR and Quartiles are not generated as expected in R
body: <p>I am new to R and statistics. Please bear with me in this question.</p>
  
  <p>I want to find the Quartiles and IQR of numbers from 1:8.
  I calculated to find that Q2 = (4+5)/2 = 4.5
  Q1 = (2+3)/2 = 2.5 and Q3 = (6+7)/2 = 6.5</p>
  
  <p>The IQR = 6.5-2.5 = 4</p>
  
  <p>However R is giving some different values. I am not able to understand where am I wrong.</p>
  
  <pre><code>&gt; quantile(1:8)
    0%  25%  50%  75% 100%
  1.00 2.75 4.50 6.25 8.00
  
  &gt; IQR(1:8)
  [1] 3.5
  </code></pre>
  
  <p>It'll be great if someone could point out my mistake.</p>