title: R Only extract 3 digit numbers from a string
body: <p>I have the following data</p>
  
  <pre><code>data &lt;- data.frame(make=c("af455f5","255tfd4d3","ojt100","12unin234mimo24","sh469dh","6ht6k778k9","kjh457"),
                 type=c("a","a","a","a","b","a","b"))
  </code></pre>
  
  <p>I only want to extract any three digit numbers from the "make" elements if the corresponding type is "a".</p>
  
  <p>I've tried using gsub but can only seem to extract all the numbers in a combined string.</p>
  
  <p>the result I'm looking for is as follows</p>
  
  <pre><code>result &lt;- c("455","255","100","234","778")
  </code></pre>