title: R loop doesn't give an error but no output either, what could be the issue with the code?
body: <p>I am new with R and got stuck with this loop code. I want to see in which rows column 3 values and column 2 values are unequal.</p>
  <p>I have created a data frame list, by extracting columns from a dataset PFC_DATA.</p>
  <p>list &lt;- as.data.frame(PFC_Data[ ,c(1,6,10)])</p>
  <p>And then created the loop with two conditions. Since the column 3 has a bunch of NAs, if it is an NA, then skip, otherwise, if column 3 has a value that is unequal to column 2 value, print the row numbers. That's the code:</p>
  <pre class="lang-r prettyprint-override"><code>for (i in 1:1840) {
      if (list[[3]][[i]] == is.na())
        next
      else {
        if (list[[3]][[i]] != list[[2]][[i]]) {
          print(i)
        }
      }
  }
  </code></pre>
  <p>I also tried ==&quot;NA&quot;. However, in either case nothing happens. I do not get any error, but no output either. Any ideas?</p>