ldiMatrix-class
Class "ldiMatrix" of Diagonal Logical MatricesThe class "ldiMatrix"
of logical diagonal matrices.
Objects can be created by calls of the form new("ldiMatrix", ...)
but typically rather via Diagonal
.
x
:"logical"
vector.
diag
:"character"
string, either "U" or "N", see ddiMatrix
.
Dim
,Dimnames
:matrix dimension and dimnames
, see the Matrix
class description.
Class "diagonalMatrix"
and class "lMatrix"
, directly.
Class "sparseMatrix"
, by class "diagonalMatrix"
.
Classes ddiMatrix
and diagonalMatrix
; function Diagonal
.
(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
Copyright (©) 1999–2012 R Foundation for Statistical Computing.
Licensed under the GNU General Public License.