title: Sample() in R returning non-random sample after population vector length > 13. Why?
body: <p>The following code will return a perfectly sound sample:</p>
  <pre><code>b &lt;- sample(c(0,1,2,3,4,5,6,7,8,9,10,11,12), 100000, replace=TRUE)
  hist(b)
  </code></pre>
  <p><img src="https://i.stack.imgur.com/p6KME.jpg" alt="enter image description here" /></p>
  <p>Increasing the number for elements by 1 to 14 will result into this:</p>
  <pre><code>b &lt;- sample(c(0,1,2,3,4,5,6,7,8,9,10,11,12,13), 100000, replace=TRUE)
  hist(b)
  </code></pre>
  <p><img src="https://i.stack.imgur.com/CIOpB.jpg" alt="enter image description here" /></p>
  <p>That's clearly not correct. Zero occurs more often that it should. Is there a reason for this?</p>