title: Check if value == integer(0) in R
body: <p>I'm using the <code>grep</code> function in R to check if a conditional regular expression is met.</p>
  
  <p>What I have is this:  <code>grep(expression, string)</code> where an example might be</p>
  
  <pre><code>   value=  grep("\\s[A-z]", "  ")
     value
  </code></pre>
  
  <p>which outputs </p>
  
  <blockquote>
    <p>integer(0)</p>
  </blockquote>
  
  <p>What I want to be able to do is check is if <code>value == integer(0)</code> and </p>
  
  <p>return <strong>TRUE</strong> if <code>value</code> is <code>integer(0)</code></p>
  
  <p>return <strong>FALSE</strong> if <code>value</code> is not <code>integer(0)</code> </p>
  
  <p>Is there a way to do this in R? If there are alternatives, I am open to them. For example, grep might have an option to output the result as a logical value,</p>
  
  <p><strong>TRUE</strong> and <strong>FALSE</strong>, or </p>
  
  <p><strong>0</strong> and <strong>1</strong> or something related.</p>