sp2Matrix {asreml} | R Documentation

## Convert sparse matrix.

### Description

Convert a sparse matrix in three column coordinate form to a `Matrix` object.

### Usage

    sp2Matrix(x, dense = FALSE, triplet = FALSE)

### Arguments

`x` | A three column matrix containing the row and column indices and the matrix element, respectively, of the sparse matrix.
`dense` | If `TRUE` (the default is `FALSE`), the result is stored as a dense symmetric `dspMatrix` object, otherwise a sparse symmetric matrix.
`triplet` | If `TRUE` (the default is `FALSE`), the result is a `CsparseMatrix`, otherwise a `TsparseMatrix` (triplet form).

### Details

If the sparse matrix inherits class `ginv`, the returned object preserves the A^{-1} attributes.

[Package asreml version 4.1.0.176 Index]