Element-wise difference with R's recycling (a shorter vector is recycled down the columns of a matrix). Equivalent to R's -.
-
subtract([[1, 2], [3, 4]], [10, 20]); // [[-9, -8], [-17, -16]]subtract([1, 2, 3], 2); // [-1, 0, 1] Copy
subtract([[1, 2], [3, 4]], [10, 20]); // [[-9, -8], [-17, -16]]subtract([1, 2, 3], 2); // [-1, 0, 1]
Element-wise difference with R's recycling (a shorter vector is recycled down the columns of a matrix). Equivalent to R's
-.