Ifelse() evalutes both cases

This is intentional. If you want something that is more compact, but behaves like if, then use the ternary operator:

x < α ? log(x) : log(-x)
3 Likes