getBandIdx: Get Band Indices

View source: R/contactGroup_utils.R

getBandIdxR Documentation

Get Band Indices

Description

Get the indices corresponding to a matrix band.

Usage

getBandIdx(n, band.no)

Arguments

n

The number of rows/columns of a contact matrix

band.no

Integer specifying which matrix band. band.no = 1 retrieves the main diagonal.

Details

This function is used in subsetting contact matrices, primarily in getBandMatrix. However, users wishing to extract band matrices directly may find this useful

Value

A matrix with 2 columns and as many rows as entries in the matrix band.

See Also

ContactGroup, getBandMatrix, band

Examples

data(cgEx)
b2.idx <- getBandIdx(nrow(cgEx), 2)

hansenlab/bnbc documentation built on Feb. 4, 2024, 7:20 a.m.