row_wise_subtraction | R Documentation |
Calculates the subtraction of a vector to each row of a matrix
row_wise_subtraction(X, vect)
X |
matrix (n x m) |
vect |
vector of length m |
an (n x m) matrix, Y, where Y[i,] = X[i,]-vect
X <- matrix(c(1,2,3,4,5,6,7,8), nrow = 4, ncol = 2, byrow = T) row_wise_subtraction(X = X, vect = c(1,2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.