operators {matricks} | R Documentation |
Binary operations on matrices/vectors
Description
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
Usage
a %m% b
a %d% b
a %-% b
a %+% b
Arguments
a |
matrix/vector |
b |
matrix/vector |
Value
Matrix/vector
Examples
# Multiply
m(1, 2, 3 | 4, 5, 6 | 7, 8, 9) %m% v(5,4,3)
# Divide
m(1, 2, 3 | 4, 5, 6 | 7, 8, 9) %d% v(5,4,3)
# Add
m(1, 2, 3 | 4, 5, 6 | 7, 8, 9) %+% v(5,4,3)
# Subtract
m(1, 2, 3 | 4, 5, 6 | 7, 8, 9) %-% v(5,4,3)
[Package matricks version 0.8.2 Index]