title: Extract the first 2 Characters in a string
body: <p>I need to extract the 1st 2 characters in a string to later create bin plot distribution. 
  vector:</p>
  
  <pre><code>x &lt;- c("75 to 79", "80 to 84", "85 to 89") 
  </code></pre>
  
  <p>I have gotten this far:</p>
  
  <pre><code>substrRight &lt;- function(x, n){
    substr(x, nchar(x)-n, nchar(x))
  }
  </code></pre>
  
  <p>invoke function</p>
  
  <pre><code>substrRight(x, 1)
  </code></pre>
  
  <p>Response</p>
  
  <pre><code>[1] "79" "84" "89"
  </code></pre>
  
  <p>Need to prints the last 2 characters not the first. </p>
  
  <pre><code>[1] "75" "80" "85"
  </code></pre>