View source: R/center_matrix.R
center_matrix | R Documentation |
helper function to center a numeric matrix within a (larger) target matrix size
center_matrix(output_dim, mat, default_value = NA_real_, drop_zeros = TRUE)
output_dim |
the desired dimensions of the output matrix |
mat |
the 2D numeric matrix containing values to be centered in the output matrix |
default_value |
the value that should fill padded rows and columns of the output matrix |
drop_zeros |
if TRUE, all zero-valued rows and columns of |
an expanded matrix of size output_dim
with the input matrix mat
centered
within it.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.