This operator allows to do elementwise operation of two algebraic object i.e. matrices/vectors. There is one required condition to perform such operation: at least one domension values from both objects must be the same
a %m% b a %d% b a %-% b a %+% b
a | matrix/vector |
---|---|
b | matrix/vector |
Matrix/vector
#> [,1] [,2] [,3] #> [1,] 5 10 15 #> [2,] 16 20 24 #> [3,] 21 24 27#> [,1] [,2] [,3] #> [1,] 0.200000 0.400000 0.6 #> [2,] 1.000000 1.250000 1.5 #> [3,] 2.333333 2.666667 3.0#> [,1] [,2] [,3] #> [1,] 6 7 8 #> [2,] 8 9 10 #> [3,] 10 11 12#> [,1] [,2] [,3] #> [1,] -4 -3 -2 #> [2,] 0 1 2 #> [3,] 4 5 6