title: How to use logical operator (!) with magrittr in R
body: <p>I am taking a list of values and trying to find those that are not NA using magrittr.  Here is a simple example:</p>
  
  <pre><code>data.frame(data = c(1:2, NA, 4:5, NA, 7)) %&gt;% is.na
  </code></pre>
  
  <p>which yields the correct result:</p>
  
  <pre><code>      data
  [1,] FALSE
  [2,] FALSE
  [3,]  TRUE
  [4,] FALSE
  [5,] FALSE
  [6,]  TRUE
  [7,] FALSE
  </code></pre>
  
  <p>When I put the not operator <code>!</code> in front of <code>is.na</code>, I get an error:</p>
  
  <pre><code>data.frame(data = c(1:2, NA, 4:5, NA, 7)) %&gt;% !is.na
  </code></pre>
  
  <p>gives me </p>
  
  <p><code>Error in FUN(left, right) : operations are possible only for numeric, logical or complex types</code></p>
  
  <p>After many trials, I stumbled upon this, which works:</p>
  
  <pre><code> data.frame(data = c(1:2, NA, 4:5, NA, 7)) %&gt;% is.na %&gt;% !.
  
        data
  [1,]  TRUE
  [2,]  TRUE
  [3,] FALSE
  [4,]  TRUE
  [5,]  TRUE
  [6,] FALSE
  [7,]  TRUE
  </code></pre>
  
  <p>My question is whether there is a different way to do this.  There are other alias options in the package but I don't see any examples of them.  One is "not".  Maybe I should be using that instead? </p>
  
  <p>I realize that I have answered my question to some degree, but I would like to know if this can be done without having to resort to <code>%&gt;% !.</code> at the end.</p>