inla.as.sparse {INLA} | R Documentation |
Convert a matrix or sparse matrix into the sparse format used by INLA (dgTMatrix)
inla.as.sparse(...) inla.as.dgTMatrix(A, unique = TRUE, na.rm = FALSE, zeros.rm = FALSE)
... |
The arguments. The matrix or sparse matrix, and the additonal arguments |
A |
The matrix |
unique |
Logical. If |
na.rm |
Replace |
zeros.rm |
Remove zeros in the matrix. |
inla.as.sparse
and inla.as.dgTMatrix
is the same function.
The returned value is a sparse matrix in the dgTMatrix
-format.
Havard Rue hrue@r-inla.org
A = matrix(1:9, 3, 3) inla.as.sparse(A)