Pipe not working?

I found strange behavior in my RStudio using tydeverse... maybe is my own error.
I have a current situation:
a <- 2
b <- 5
maximo <- if (a > b) a else b

I get the right answer maximo = 5

maximo %>% if (a > b) a else b

I get FALSE as answer...

Someboby can help me?

I suggest you read up on what the pipe operator does:

1 Like

Tks! This was a very suggestion !

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.