resizeMatrix | R Documentation |
resize a numeric matrix to given dimensions
resizeMatrix(mat, ndim = dim(mat), method = c("mean", "max", "min"))
mat |
A numeric matrix |
ndim |
The desired output dimensions |
method |
Whether to use normal interpolation ('method="mean"', the default), or the max or min of the overlapping grid cells. |
For most cased this is based on Vyha's implementation (taken from https://stackoverflow.com/a/23429527 ), but adding the possibility to replace normal interpolation with the max/min of the overlapping grid cells. This works well when the desired dimensions are at least half of the input ones. When the desired dimensions are smaller, a different binning method is used, first applied on columns and then on rows.
A numeric matrix of dimensions 'ndim'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.