I would like to do several actions in dplyr pipe when some statement is true.
For such data:
t = tibble(a = 1:3, b = 1:3, c = 1:3, d = 1:3, e = 1:3)
I would like to write somehow that if
a == 2
then
b = b + 2
c = c + 3
d = d + 4
e = e + 5
Basically, I do not want to repeat the if condition several times because if it changed I would need to update it in several places which is error-prone.