title: R - " missing value where TRUE/FALSE needed "
body: <p>I'm trying to execute the following code in R</p>
  
  <pre><code>comments = c("no","yes",NA)
  for (l in 1:length(comments)) {
      if (comments[l] != NA) print(comments[l]);
  }
  </code></pre>
  
  <p>But I'm getting an error</p>
  
  <pre><code>Error in if (comments[l] != NA) print(comments[l]) : missing value where TRUE/FALSE needed
  </code></pre>
  
  <p>What's going on here? </p>