this is something that was introduced into Matrix package a few months ago :
R: News for R Package 'Matrix' (r-project.org)
- New nonvirtual class
ndiMatrix
, extending virtual classesdiagonalMatrix
andnMatrix
, for nonzero pattern diagonal matrices. It is used to represent the result ofis.na
,is.nan
,is.infinite
applied todiagonalMatrix
, as well as diagonal boolean products. Coercionsas(<diagonalMatrix>, "nMatrix")
now givendiMatrix
instead ofntCMatrix
. The latter can for now still be obtained by coercing tonsparseMatrix
instead ofnMatrix
.