powered by
toggle the sign of an expression
toggle.sign(x)
expression
`toggle.sign` changes the sign of an expression for `+` tp `-` and visa-versa.
# NOT RUN { toggle.sign(1:3) toggle.sign( quote(a) ) toggle.sign( quote(-a) ) exp <- expression( a, -b, -(a-b) ) toggle.sign(exp) # }
Run the code above in your browser using DataLab