R: List out a bdsmatrix as row/col/value triplets

listbdsmatrix {bdsmatrix} | R Documentation

## List out a bdsmatrix as row/col/value triplets

### Description

This routine is the inverse of the bdsmatrix.ibd function found in the kinship library.

### Usage

    listbdsmatrix(x, id = TRUE, diag = FALSE)

### Arguments

`x` | a `bdsmatrix` object
`id` | if true, the dimnames of the object are used as the row and column identifiers in the output, if false integer row and column numbers are used
`diag` | include the diagonal elements in the output

### Details

The non-zero elements of the matrix are listed out as row-col-value triplets, one per line, in a data frame. Since the matrix is known to be symmetric, only elements with row >= col are listed. When familial correlation data is represented in a bdsmatrix, e.g. kinship or identity-by-descent information, the diagonal is a known value and can be omitted from the listing. Genetic software often produces matrices in the list form; this routine is the inverse of the bdsmatrix.ibd routine, found in the kinship library, which converts list form to bdsmatrix form.

### Value

a data frame with variables `row`, `col`, and `value`.

### Author(s)

Terry Therneau

### See Also

`bdsmatrix`

[Package bdsmatrix version 1.3-2 Index]