title: R Comparison of integers seems to neglect number of digits
body: <p>I have coordinates in one dimension, which describe the beginning and end of a segment. I am trying to write a function, which tells me is one segment is within another. This is what I have, in this case to see if b is inside a:</p>
  
  <pre><code>isin &lt;- function(a, b){
  
  if (a[beginning] &lt;= b[beginning] &amp;&amp; a[end] &gt;= b[end]){
    return TRUE
  } 
  </code></pre>
  
  <p>The problem is, that it does not seem to respect different lengths of the numbers, for example:</p>
  
  <pre><code>a &lt;- c(2345, 2380)
  b &lt;- c(234600, 237900)
  isin(a, b)
  TRUE
  </code></pre>
  
  <p>Its as if the two numbers are put side by side starting from the first, and anything non overlapping is truncated. I am pretty new to this stuff, so excuse me if I am missing some basic property of integers.</p>