blockmin | R Documentation |
Given a matrix and the size of a block, returns a new matrix containing the min value for each block.
blockmin(mat, block)
mat |
numeric matrix |
block |
integer vector of length 2, containing the size of the block (rows, columns). If only one integer is passed, the block is square |
A new reduced matrix with min value of each block
mat <- matrix(1:64, nrow = 8, byrow = TRUE)
mat
blockmin(mat, 2) # or blockmin(mat, c(2, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.