title: Struggling to understand Q1 calculation
body: <p>suppose we have the following data set (length 24):</p>
  <pre><code>x &lt;- c(30L, 49L, 105L, 115L, 118L, 148L, 178L, 185L, 196L, 210L, 236L, 236L,
  278L, 287L, 329L, 362L, 366L, 399L, 430L, 434L, 451L, 451L, 477L, 488L, 508L,
  531L, 533L, 542L)
  </code></pre>
  <p>If we calculate the five-number summary:
  Minimum is 30, Maximum: 542, Median: (287 + 329) /2 = 308...that was the easy part!</p>
  <ul>
  <li>Q1 is the median of the subset [30, 49,105,....287], length 14 --&gt; Q1 = [178 + 185]/2 = 181.5</li>
  <li>Q3 &quot; &quot; &quot; &quot; [329,362,...,542] = [451 + 451] / 2 = 451</li>
  </ul>
  <p>Now if we check that with function <code>summary(dataset)</code> ... we get:</p>
  <pre><code>Min.   1st Qu.  Median    Mean    3rd Qu.    Max. 
  30.0   183.2    308.0     309.7   451.0      542.0
  </code></pre>
  <p>Why do we get a different Q1? How does the function <code>summary</code> calculate Q1?</p>