partition: Split a matrix into blocks

View source: R/partition.R

partitionR Documentation

Split a matrix into blocks

Description

This function split a matrix into a list of blocks (either by rows and columns).

Usage

partition(Matrix, nrows, ncols)

Arguments

Matrix

a matrix to split .

nrows

positive integer indicating the number of rows blocks.

ncols

positive integer indicating the number of columns blocks.

Value

a list of partitioned submatrices

Examples

Mat = matrix(c(1,0.5,0,0,
                  0.5,2,0,0,
                  0,0,3,0.2,
                  0, 0, 0.2,4), nrow = 4, ncol = 4, byrow = TRUE)
partition(Matrix = Mat, nrows = 2, ncols = 2)

PSinference documentation built on April 4, 2025, 2:08 a.m.