Learn R Programming

formula.tools (version 1.7.1)

toggle.sign: toggle the sign of an expression

Description

toggle the sign of an expression

Usage

toggle.sign(x)

Arguments

x

expression

Details

`toggle.sign` changes the sign of an expression for `+` tp `-` and visa-versa.

Examples

Run this code
# 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