title: best way to check if an object is null or empty string in r
body: <p>I want to check if a variable is <code>''</code> or 'NULL'. I did below:</p>
  
  <pre><code>x =NULL #or ''
  
  if(is.null(x) || x=='') {
      print('nothing')
  } else {
      print(x)
  }
  </code></pre>
  
  <p>My question is what is the best way to check this condition? I feel like there is some better way to do this...</p>