title: Check if a string contains at least one numeric character in R
body: <p>I have tried the following, however, it goes wrong when the string contains any other character, say a space. As you can see below, there is a string called "subway 10", which does contain numeric characters, however, it is reported as false because of the space.</p>
  
  <p>My string may contain any other character, but if it contains at least a single digit, I would like to get the indices of those strings from the array.</p>
  
  <pre><code>&gt; mywords&lt;- c("harry","met","sally","subway 10","1800Movies","12345")
  &gt; numbers &lt;- grepl("^[[:digit:]]+$", mywords) 
  &gt; letters &lt;- grepl("^[[:alpha:]]+$", mywords) 
  &gt; both &lt;- grepl("^[[:digit:][:alpha:]]+$", mywords) 
  &gt; 
  &gt; mywords[xor((letters | numbers), both)] # letters &amp; numbers mixed 
  [1] "1800Movies"
  </code></pre>