balance: Inserts 0 columns and rows after last row/column to...

Description Usage Arguments Value Examples

View source: R/utility_functions.R

Description

Inserts 0 columns and rows after last row/column to symmetrize matrix.

Usage

1
balance(mtx, N = NULL)

Arguments

mtx

matrix in dense format to be symmetrized

N

positive integer; additional argument for symmetrizing matrix to desired N x N dimension; N need not be larger than ncol(mtx) or nrow(mtx) in which case submatrix mtx[1:N,1:N] will be extraced

Value

N by N matrix which is either submatrix of mtx or mtx extended with 0's row and/or columns

Examples

1
2
3
4
5
6
7
8
mtx1 <- matrix(1:24, ncol = 4)
mtx2 <- matrix(1:24, nrow = 4)
print(mtx1)
print(mtx2)
balance(mtx1)
balance(mtx2)
balance(mtx1, N = 8)
balance(mtx1, N = 3)

rz6/CopulaHiC documentation built on Dec. 31, 2019, 9:19 a.m.