gmult | R Documentation |
Multiplying specific submatrices of a spam matrix with different factors.
gmult(x, splits, fact)
x |
a spam matrix. |
splits |
vector of how to split the matrix into submatrices.
It starts with |
fact |
matrix of factors to multiply submatrices defined by splits.
Dimensions of |
Spam matrix, where each specified submatrix is multiplied with a factor.
Florian Gerber, Roman Flury
x <- spam(1, 15, 15)
print(x, minimal = FALSE)
splits <- c(1,2,8,ncol(x)+1) # divide matrix into 9 submatrices
fact <- array(1:9, c(3,3)) # multiply each submatrix with a different factor
oF <- gmult(x, splits, fact)
print(oF, minimal = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.