partition {PSinference}R 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

df = matrix(c(1,0.5,0,0,
                  0.5,2,0,0,
                  0,0,3,0.2,
                  0, 0, 0.2,4), nr = 4, nc = 4, byrow = TRUE)
partition(df,2,2)

[Package PSinference version 0.1.0 Index]