From a sparse matrix object, the three column, row ordered lower triangle of
non-zero elements is created. Mostly used within other functions (i.e.,
makeD
)
sm2list(A, rownames = NULL, colnames = c("row", "column", "A"))
returns the list form of the sparse matrix as a data.frame
a sparse matrix
a list of rownames from the 'A' matrix.
the columns will be labeled however they are entered in this character vector
The sparse matrix and three column format must fit CERTAIN assumptions about row/column sorting and lower/upper triangle matrix.
Adapted from a function in the MCMCglmm
package
MCMCglmm