Minus {lazy.symbolic} | R Documentation |
Difference of Two or More Symbolic Expressions
Minus(..., simplify = 1, debug = 0)
... |
Symbolic matrices or vectors to be subtracted. |
simplify |
= 0 not to use Simplify nor remove_paren |
debug |
= 1 to print intermediate result |
Tow matrices of the same dimensions can be added or subtraced.
A scalar can be added to or subtracted from a matrix
Numeric matrices will be treated as character ones.
When you want to chage the sign of all the elements of a matrix, use
A1 <- Minus( 0, A ) or A1 <- Times( -1, A )
Minus( A, B, C, ...) -> A-B-C-...
If the arguments are super matrices with SMdim attributes, the final result will have an appropriate SMdim attribute.
A character matrix
Minus( 3,2,1 )
A <- demomat(3,3,root="a")
A[2,2] <- paste("-",A[2,2],sep="")
B <- demomat(3,3,root="b")
B[3,3] <- 0
Minus( A, B )
Minus( A, 1 )