Learn R Programming

diagonals (version 0.2.0)

minus_block_matrix: Minus Block Matrix

Description

Minus Block Matrix

Usage

minus_block_matrix(x, steps = NULL, size = NULL, replacement = 0)

Arguments

x
a square matrix where the dimensions are integer multiples of size or integer dividors of steps
steps
the required number of steps (block matrices) across the diagonal
size
the width or height of the matrix being dropped over the diagonal of matrix x
replacement
value to be inserted on the diagonal, by default this is zero (0).

Details

Either steps or size is expected to be provided.

Examples

Run this code
# create a square matrix
m <- matrix(1:64, nrow=8)

# select a block matrix with two steps
minus_block_matrix(m, steps=2)

# select a block matrix with four steps
minus_block_matrix(m, steps=4)

Run the code above in your browser using DataLab