lower.tri {spam} | R Documentation |
Returns the lower or upper triangular structure or entries of a sparse matrix.
lower.tri(x, diag = FALSE) upper.tri(x, diag = FALSE)
x |
a sparse matrix of class spam |
diag |
logical. Should the diagonal be included? |
Often not only the structure of the matrix is required but the
entries as well. For compatibility, the default is only a structure
consisting of ones (representing TRUE
s). Setting the flag
spam.getOption('trivalues')
to TRUE
,
the function returns the actual
values.
spam.options
and diag
smat <- spam( c( 1,2,0,3,0,0,0,4,5),3) upper.tri( smat) upper.tri( smat, diag=TRUE) spam.options( trivalues=TRUE) upper.tri( smat)