dt_matrix: Upper triangle sparse symmetric triplet matrix to dense...

View source: R/utils.R

dt_matrixR Documentation

Upper triangle sparse symmetric triplet matrix to dense matrix

Description

Convenience function for returning square, dense symmetric matrices from the upper triangle of triplet format symmetric matrices.

Usage

dt_matrix(x, i, j, dim, offset)

Arguments

x

A numeric vector containing the data for matrix elements.

i

A integer vector parallel to x containing row positions.

j

A integer vector parallel to x containing column positions.

dim

A integer of length 1 specifying the dimensions of the output matrix.

offset

A integer of length 1 noting a potential offset in the i and j arguments.

Particularly useful when lookup up square regions around the diagonal in Hi-C data.

Value

A dim * dim sized matrix.

Note

For reasons of speed, no checks are performed wether the input is compatible with sensible output.


robinweide/GENOVA documentation built on March 14, 2024, 11:16 p.m.