round_by_blocks {cuadramelo} | R Documentation |
Round matrix by blocks
Description
Applies round_matrix()
to equally-sized blocks that partition the
matrix either vertically or horizontally.
Usage
round_by_blocks(Y, layout, L, digits = 0, MARGIN_BLOCK = 0)
Arguments
Y |
Matrix. |
layout |
The blocks are distributed: 1 horizontally, 2 vertically. |
L |
Number of lines that a block encompasses. |
digits |
Number of decimal places to be rounded to. |
MARGIN_BLOCK |
For each block
|
Value
The rounded matrix.
Examples
set.seed(10)
Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
X <- round_by_blocks(Y, 2, 4)
U <- Y[5:8,] |> round_matrix()
X[5:8,] - U
[Package cuadramelo version 1.0.0 Index]