title: R data suppression that ignores non-integers
body: <p>I am trying to suppress all values in my data frame that are less than 5.<br />
  <code>data[data &lt; 5] &lt;- NA</code><br />
  For the most part this works fine. However I also have some values that are categorical age groups &quot;0-19&quot; &quot;20-24&quot; and so on. I guess R is doing the subtraction and removing these as well. Is there a way to do this that ignores any value that isn't an integer?</p>
  <p>Edit:  Some dummy data as an example:</p>
  <pre><code>dummydata&lt;-as.data.frame(rbind(c('0-19','4','5'),c('20-24','6','1')))
  &gt; dummydata
       [,1]    [,2] [,3]
  [1,] &quot;0-19&quot;  &quot;4&quot;  &quot;5&quot; 
  [2,] &quot;20-24&quot; &quot;6&quot;  &quot;1&quot;   
  dummydata[dummydata &lt; 5] &lt;- NA
  &gt; dummydata
       [,1] [,2] [,3]
  [1,] NA   NA   &quot;5&quot; 
  [2,] NA   &quot;6&quot;  NA  
  </code></pre>
  <p>Desired output:</p>
  <pre><code>     [,1]    [,2] [,3]
  [1,] &quot;0-19&quot;  NA  &quot;5&quot; 
  [2,] &quot;20-24&quot; &quot;6&quot;  NA 
  </code></pre>