title: how to use the return value of function grep in R
body: <p>I want to use the return value of function grep, I just want to judge whether the var_name has the var I want:</p>
  
  <pre><code>&gt; res&lt;-grep(y,var_name,fixed=FALSE)
  &gt; res
  integer(0)
  &gt; (res==integer(0))
  logical(0)
  &gt; (res==NULL)
  logical(0)
  </code></pre>
  
  <p>But it is always logical(0), is there any way I can solve this problem </p>