I have run across a situation where %>% produces very surprising output when combined with !. Consider the following code:
%>%
!
x <
I suspect that it's an order of operations issue:
!is.na(x) %>% sum
is evaluating to
!(is.na(x) %>% sum)
Which is equivalent to TRUE
TRUE