| blockmax | R Documentation | 
Given a matrix and the size of a block, returns a new matrix containing the max value for each block.
blockmax(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 max value of each block
mat <- matrix(1:64, nrow = 8, byrow = TRUE)
mat
blockmax(mat, 2) # or blockmax(mat, c(2, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.