powered by
The class "ldiMatrix" of logical diagonal matrices.
"ldiMatrix"
Objects can be created by calls of the form new("ldiMatrix", ...) but typically rather via Diagonal.
new("ldiMatrix", ...)
Diagonal
x
"logical" vector.
"logical"
diag
"character" string, either "U" or "N", see ddiMatrix.
"character"
ddiMatrix
Dim
Dimnames
matrix dimension and dimnames, see the Matrix class description.
dimnames
Matrix
Class "diagonalMatrix" and class "lMatrix", directly.
"diagonalMatrix"
"lMatrix"
Class "sparseMatrix", by class "diagonalMatrix".
"sparseMatrix"
Classes ddiMatrix and diagonalMatrix; function Diagonal.
diagonalMatrix
(lM <- Diagonal(x = c(TRUE,FALSE,FALSE))) str(lM)#> gory details (slots) crossprod(lM) # numeric (nM <- as(lM, "nMatrix"))# -> sparse (not formally ``diagonal'') crossprod(nM) # logical sparse
Run the code above in your browser using DataLab