> v <- c(1,2,NA,5)
> is.na(v)
[1] FALSE FALSE TRUE FALSE
> !is.na(v)
[1] TRUE TRUE FALSE TRUE
>
> !is.na(v) %>% all()
[1] TRUE
> all(!is.na(v))
[1] FALSE
> (!is.na(v)) %>% all()
[1] FALSE
In the absence of parenthesis, %>%
is applying all() to is.na(v)
and then applying !
operator. Why does it have such order of operation here, and for what other functions/operators should I be weary of this?