title: Extract/Remove portion of an Integer or string with random digits/characters in R
body: <p>Say I have an integer </p>
  
  <pre><code>x &lt;- as.integer(442009)
  </code></pre>
  
  <p>or a character string</p>
  
  <pre><code>y &lt;- "a10ba3m1"
  </code></pre>
  
  <p>How do I eliminate the last two digits/character of integer/string of any length in general ?</p>